Sha256: bd4fd6f79e924d9cbda0b56a760cbb196135827c8fbf9970cd065c2be30b41f2

Contents?: true

Size: 608 Bytes

Versions: 2

Compression:

Stored size: 608 Bytes

Contents

module I18n
  module Airbrake
    class Handler

      def initialize(exception, locale, key, options)
        @exception, @locale, @key, @options = exception, locale, key, options
      end

      def call
        if Rails.env.development? or Rails.env.test?
          fail exception
        else
          notify
          @key.to_s.titleize
        end
      end

      def exception
        if @exception.respond_to?(:to_exception)
          @exception.to_exception
        else
          @exception
        end
      end

      def notify
        ::Airbrake.notify exception
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i18n-airbrake-0.0.2 lib/i18n-airbrake/handler.rb
i18n-airbrake-0.0.1 lib/i18n-airbrake/handler.rb