Class: RailsInformant::ErrorSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_informant/error_subscriber.rb

Constant Summary collapse

SKIP_SOURCES =
/_cache_store\.active_support\z/

Instance Method Summary collapse

Instance Method Details

#report(error, handled:, severity:, context:, source: nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rails_informant/error_subscriber.rb', line 5

def report(error, handled:, severity:, context:, source: nil)
  return unless RailsInformant.initialized?
  return if handled && severity == :info
  return if source && SKIP_SOURCES.match?(source)
  return if RailsInformant::Current.silenced
  return if below_job_attempt_threshold?(context)
  return if RailsInformant.ignored_exception?(error)
  return if RailsInformant.already_captured?(error)

  RailsInformant.mark_captured!(error)

  ErrorRecorder.record error, severity: severity.to_s, context:, source:
end