Sha256: f46f01f3a0ee2cee4fdf01552b1199b16bcbe87d450cd9d01ce750692374bf7c

Contents?: true

Size: 424 Bytes

Versions: 1

Compression:

Stored size: 424 Bytes

Contents

# frozen_string_literal: true
unless Rails.env.production?
  module I18n
    class JustRaiseExceptionHandler < ExceptionHandler
      def call(exception, locale, key, options)
        if exception.is_a?(MissingTranslationData) || exception.is_a?(MissingTranslation)
          raise exception.to_exception
        end

        super
      end
    end
  end

  I18n.exception_handler = I18n::JustRaiseExceptionHandler.new
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-core-0.1.0 lib/decidim/i18n_exceptions.rb