Parent

Class Index [+]

Quicksearch

ActionDispatch::Rescue

Public Class Methods

new(app, rescuers = {}, &block) click to toggle source
   # File lib/action_dispatch/middleware/rescue.rb, line 3
3:     def initialize(app, rescuers = {}, &block)
4:       @app, @rescuers = app, {}
5:       rescuers.each { |exception, rescuer| rescue_from(exception, rescuer) }
6:       instance_eval(&block) if block_given?
7:     end

Public Instance Methods

call(env) click to toggle source
    # File lib/action_dispatch/middleware/rescue.rb, line 9
 9:     def call(env)
10:       @app.call(env)
11:     rescue Exception => exception
12:       if rescuer = @rescuers[exception.class.name]
13:         env['action_dispatch.rescue.exception'] = exception
14:         rescuer.call(env)
15:       else
16:         raise exception
17:       end
18:     end

Protected Instance Methods

rescue_from(exception, rescuer) click to toggle source
    # File lib/action_dispatch/middleware/rescue.rb, line 21
21:       def rescue_from(exception, rescuer)
22:         exception = exception.class.name if exception.is_a?(Exception)
23:         @rescuers[exception.to_s] = rescuer
24:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.