Sha256: c29e3cd4e1b8822481d2ab3266e3dc844fc39bc5e1b17444d3215af5a56a0f5c

Contents?: true

Size: 848 Bytes

Versions: 11

Compression:

Stored size: 848 Bytes

Contents

class Flail
  module Rails
    module RescueAction
      # Sets up an alias chain to catch exceptions when Rails does
      def self.included(base)
        base.send(:alias_method, :rescue_action_in_public_without_flail, :rescue_action_in_public)
        base.send(:alias_method, :rescue_action_in_public, :rescue_action_in_public_with_flail)
      end

      private

      # Overrides the rescue_action method in ActionController::Base
      # but uses any custom processing that is defined with
      # Rails 2's exception helpers.
      def rescue_action_in_public_with_flail(exception)
        request.env['flail.request'] = request
        request.env['flail.request.data'] = flail_request_data

        Flail::Exception.new(request.env, exception).handle!
        rescue_action_in_public_without_flail(exception)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
flail-0.1.6 lib/flail/rails/rescue_action.rb
flail-0.1.5 lib/flail/rails/rescue_action.rb
flail-0.1.4 lib/flail/rails/rescue_action.rb
flail-0.1.3 lib/flail/rails/rescue_action.rb
flail-0.1.2 lib/flail/rails/rescue_action.rb
flail-0.1.1 lib/flail/rails/rescue_action.rb
flail-0.1.0 lib/flail/rails/rescue_action.rb
flail-0.0.7 lib/flail/rails/rescue_action.rb
flail-0.0.6 lib/flail/rails/rescue_action.rb
flail-0.0.5 lib/flail/rails/rescue_action.rb
flail-0.0.4 lib/flail/rails/rescue_action.rb