Class: Rexception::ExceptionsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/rexception/exceptions_controller.rb

Constant Summary collapse

STATUSES =
Rack::Utils::SYMBOL_TO_STATUS_CODE.select { |_, code| code >= 400 }

Class Method Summary collapse

Class Method Details

.call(env) ⇒ Object



34
35
36
# File 'lib/rexception/exceptions_controller.rb', line 34

def call(env)
  action(status(env)).call(env)
end

.exception(env) ⇒ Object



42
43
44
# File 'lib/rexception/exceptions_controller.rb', line 42

def exception(env)
  env['action_dispatch.exception']
end

.status(env) ⇒ Object



38
39
40
# File 'lib/rexception/exceptions_controller.rb', line 38

def status(env)
  ActionDispatch::ExceptionWrapper.rescue_responses[exception(env).class.name]
end