Sha256: e59e298d21091968bad95a6f04d302947a2f756931d6a320278d25e5ca55e61c

Contents?: true

Size: 623 Bytes

Versions: 13

Compression:

Stored size: 623 Bytes

Contents

module SolidusSixSaferpay

  class ErrorHandler
    # Use a custom error handler so that host applications can configure their
    # error handling
    def self.handle(error, level: :error)
      Rails.logger.send(level, error)

      Configuration.error_handlers.each do |handler|
        if !handler.respond_to?(:call)
          Rails.logger.warn("SolidusSixSaferpay::Configuration ERROR: The attached error handler #{handler} can not be called with #{handler}.call(error, level: level)")

          # skip to next handler
          next
        end
        handler.call(error, level: level)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
solidus_six_saferpay-0.5.0 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.4.0 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.3.0 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.8.1 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.2.0 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.8 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.7 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.5 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.4 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.3 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.2 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.1 lib/solidus_six_saferpay/error_handler.rb
solidus_six_saferpay-0.1.0 lib/solidus_six_saferpay/error_handler.rb