Module: Perfectline::T9n::Backend::ExceptionHandler::ClassMethods

Defined in:
lib/t9n/backend/exception_handler.rb

Instance Method Summary collapse

Instance Method Details

#hoptoad_exception_handler(exception, locale, key, scope) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/t9n/backend/exception_handler.rb', line 11

def hoptoad_exception_handler(exception, locale, key, scope)

  unless defined?(HoptoadNotifier)
    raise RuntimeError, "HoptoadNotifier is not present, please get it from http://hoptoadapp.com/"
  end

  case exception
    when MissingTranslationData
      HoptoadNotifier.notify(exception)
    else
      raise exception
  end

  return exception.message
end