Sha256: b87dd0f195953d6fa387ed53b56df45519d96f8c5f7e9e4f0a59c62b6d9c1e6d

Contents?: true

Size: 1.1 KB

Versions: 58

Compression:

Stored size: 1.1 KB

Contents

# Rails 2.x only
module Bugsnag::Rails
  module ActionControllerRescue
    def self.included(base)
      # Hook into rails exception rescue stack
      base.send(:alias_method, :rescue_action_in_public_without_bugsnag, :rescue_action_in_public)
      base.send(:alias_method, :rescue_action_in_public, :rescue_action_in_public_with_bugsnag)

      base.send(:alias_method, :rescue_action_locally_without_bugsnag, :rescue_action_locally)
      base.send(:alias_method, :rescue_action_locally, :rescue_action_locally_with_bugsnag)

      # Run filters on requests to capture request data
      base.send(:prepend_before_filter, :set_bugsnag_request_data)
    end

    private
    def set_bugsnag_request_data
      Bugsnag.clear_request_data
      Bugsnag.set_request_data(:rails2_request, request)
    end

    def rescue_action_in_public_with_bugsnag(exception)
      Bugsnag.auto_notify(exception)

      rescue_action_in_public_without_bugsnag(exception)
    end

    def rescue_action_locally_with_bugsnag(exception)
      Bugsnag.auto_notify(exception)

      rescue_action_locally_without_bugsnag(exception)
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
bugsnag-2.5.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.5.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.4.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.4.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.3.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.2.2 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.2.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.2.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.1.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.0.3 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.0.2 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.0.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-2.0.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.8 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.7 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.6 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.5 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.4 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.3 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.2 lib/bugsnag/rails/action_controller_rescue.rb