Sha256: 17dcb49fe592fcf0d2880a5ce179ee3f4089465a411f83a64f0c826f7f2220d6

Contents?: true

Size: 372 Bytes

Versions: 3

Compression:

Stored size: 372 Bytes

Contents

require 'action_dispatch/middleware/public_exceptions'

module ErrMerchant
  class ExceptionsApp
    def call(env)
      status = env["PATH_INFO"][1..-1]
      ErrMerchant::ErrorsController.action(Rack::Utils::SYMBOL_TO_STATUS_CODE.invert[status.to_i]).call(env)
    rescue
      ActionDispatch::PublicExceptions.new(Rails.root.join('public')).call(env)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
err_merchant-0.3.1 lib/err_merchant/exceptions_app.rb
err_merchant-0.3.0 lib/err_merchant/exceptions_app.rb
err_merchant-0.2.0 lib/err_merchant/exceptions_app.rb