Sha256: 5c42a80ab2ff31eed23613142925daf7719a2fe3af52f8304adf1324460e7d47
Contents?: true
Size: 660 Bytes
Versions: 15
Compression:
Stored size: 660 Bytes
Contents
module Bugsnag::Middleware ## # Determines if the exception should be ignored based on the configured # `ignore_classes` class IgnoreErrorClass def initialize(bugsnag) @bugsnag = bugsnag end def call(report) ignore_error_class = report.raw_exceptions.any? do |ex| ancestor_chain = ex.class.ancestors.select { |ancestor| ancestor.is_a?(Class) }.to_set report.configuration.ignore_classes.any? do |to_ignore| to_ignore.is_a?(Proc) ? to_ignore.call(ex) : ancestor_chain.include?(to_ignore) end end report.ignore! if ignore_error_class @bugsnag.call(report) end end end
Version data entries
15 entries across 15 versions & 1 rubygems