Module: Bugsnag::Rails::ActiveRecordRescue

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

Constant Summary collapse

KINDS =
[:commit, :rollback].freeze

Instance Method Summary collapse

Instance Method Details

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



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

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.auto_notify(exception)
      raise
    end
  else
    # Let the post process handle the exception
    super
  end
end