Rackamole::Interceptor

Public Class Methods

included( base ) click to toggle source

For Rails only!

Rails handles raised exception in a special way. Thus special care need to be taken to enable exception to bubble up to the mole.

In order for the mole to trap framework exception, you must include the interceptor in your application controller. ie include Rackamole::Interceptor

    # File lib/rackamole/interceptor.rb, line 13
13:     def self.included( base )
14:       base.send( :alias_method_chain, :rescue_action_in_public, :mole )
15:       base.send( :alias_method_chain, :rescue_action_locally, :mole )
16:     end

Private Instance Methods

rescue_action_in_public_with_mole( exception ) click to toggle source

Instructs the mole to trap the framework exception

    # File lib/rackamole/interceptor.rb, line 28
28:       def rescue_action_in_public_with_mole( exception )
29:         # Stuff the exception in the env for mole rack retrieval
30:         request.env['mole.exception'] = exception
31:         rescue_action_in_public_without_mole( exception )
32:       end
rescue_action_locally_with_mole( exception ) click to toggle source

Instructs the mole to trap the framework exception

    # File lib/rackamole/interceptor.rb, line 21
21:       def rescue_action_locally_with_mole( exception )
22:         # Stuff the exception in the env for mole rack retrieval
23:         request.env['mole.exception'] = exception
24:         rescue_action_locally_without_mole( exception )
25:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.