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

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

Class Method Summary collapse

Class Method Details

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



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/t9n/backend/exception_handler.rb', line 6

def self.hoptoad_exception_handler(exception, locale, key, scope)
  unless defined?(HoptoadNotifier)
    throw 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