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-1.8.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.8.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.7.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.6.5 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.6.4 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.6.3 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.6.2 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.6.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.6.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.5.3 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.5.2 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.5.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.5.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.4.2 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.4.1 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.4.0 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.3.8 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.3.7 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.3.6 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.3.5 lib/bugsnag/rails/action_controller_rescue.rb