Class: Honeybadger::Plugins::Rails::ErrorSubscriber Private
- Inherits:
-
Object
- Object
- Honeybadger::Plugins::Rails::ErrorSubscriber
- Defined in:
- lib/honeybadger/plugins/rails.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .report(exception, handled:, severity:, context: {}, source: nil) ⇒ Object private
- .source_ignored?(source) ⇒ Boolean private
Class Method Details
.report(exception, handled:, severity:, context: {}, source: nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/honeybadger/plugins/rails.rb', line 34 def self.report(exception, handled:, severity:, context: {}, source: nil) # We only report handled errors (`Rails.error.handle`) # Unhandled errors will be caught by our integrations (eg middleware), # which have richer context than the Rails error reporter return unless handled return if source_ignored?(source) = ["severity:#{severity}", "handled:#{handled}"] << "source:#{source}" if source Honeybadger.notify(exception, context: context, tags: ) end |
.source_ignored?(source) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 51 |
# File 'lib/honeybadger/plugins/rails.rb', line 47 def self.source_ignored?(source) source && ::Honeybadger.config[:'rails.subscriber_ignore_sources'].any? do |ignored_source| ignored_source.is_a?(Regexp) ? ignored_source.match?(source) : (ignored_source == source) end end |