1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch/middleware/rescue.rb
Joshua Peek 11af089cee Extract ActionController rescue templates into Rescue and ShowExceptions middleware.
This commit breaks all exception catching plugins like ExceptionNotifier. These plugins should be rewritten as middleware instead overriding Controller#rescue_action_in_public.
2009-05-02 23:02:22 -05:00

14 lines
289 B
Ruby

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