Class: Lazier::Exceptions::TranslationExceptionHandler

Inherits:
I18n::ExceptionHandler
  • Object
show all
Defined in:
lib/lazier/exceptions.rb

Overview

This is the handler for the core I18n gem.

Instance Method Summary collapse

Instance Method Details

#call(exception, locale, key, options) ⇒ Object

Implements the ExceptionHandler interface for I18n.

Parameters:

  • exception (Exception)

    The error to raise.

  • locale (String|Symbol)

    The locale that was requested.

  • key (String|Symbol)

    The key that was requested.

  • options (Hash)

    The options passed to the translation.



21
22
23
# File 'lib/lazier/exceptions.rb', line 21

def call(exception, locale, key, options)
  exception.is_a?(::I18n::MissingTranslation) ? raise(exception.to_exception) : super
end