Module: Bugsnag::Rails::ActiveRecordRescue

Defined in:
lib/bugsnag/rails/active_record_rescue.rb

Instance Method Summary collapse

Instance Method Details

#run_callbacks(kind, *args, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bugsnag/rails/active_record_rescue.rb', line 3

def run_callbacks(kind, *args, &block)
  if %w(commit rollback).include?(kind.to_s)
    begin
      super
    rescue StandardError => exception
      # This exception will NOT be escalated, so notify it here.
      Bugsnag.auto_notify(exception)
      raise
    end
  else
    # Let the post process handle the exception
    super
  end
end