module Bugsnag::Rails::ActiveRecordRescue

Constants

FRAMEWORK_ATTRIBUTES
KINDS

Public Instance Methods

run_callbacks(kind, *args, &block) click to toggle source
Calls superclass method
# File lib/bugsnag/integrations/rails/active_record_rescue.rb, line 8
def run_callbacks(kind, *args, &block)
  if KINDS.include?(kind)
    begin
      super
    rescue StandardError => exception
      # This exception will NOT be escalated, so notify it here.
      Bugsnag.notify(exception, true) do |report|
        report.severity = "error"
        report.severity_reason = {
          :type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE,
          :attributes => FRAMEWORK_ATTRIBUTES
        }
      end
      raise
    end
  else
    # Let the post process handle the exception
    super
  end
end