1 2 3 4 5 6 7 8 9 10 11 12 13 14
module ActionDispatch class Rescue def initialize(app, rescuer) @app, @rescuer = app, rescuer end def call(env) @app.call(env) rescue Exception => exception env['action_dispatch.rescue.exception'] = exception @rescuer.call(env) end end end