Sha256: 7cac71d44f66a977b9faa1f6d3af4837fbe3a5e4488529da02d08b4cdd598bee

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

module Bugsnag
  module Rails
    module ActionControllerRescue
      def self.included(base)
        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)
      end

      private
      def rescue_action_in_public_with_bugsnag(exception)
        auto_notify(exception) unless Bugsnag.configuration.disable_auto_notification
        rescue_action_in_public_without_bugsnag(exception)
      end
      
      def rescue_action_locally_with_bugsnag(exception)
        auto_notify(exception) unless Bugsnag.configuration.disable_auto_notification
        rescue_action_locally_without_bugsnag(exception)
      end
      
      def auto_notify(exception)
        notify_bugsnag(exception)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bugsnag-1.0.3 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.0.2 lib/bugsnag/rails/action_controller_rescue.rb
bugsnag-1.0.1 lib/bugsnag/rails/action_controller_rescue.rb