Sha256: 876a9a9561875052107a595e8b373a68344488a3a6aaef437d07dd4ab2d887ba

Contents?: true

Size: 712 Bytes

Versions: 22

Compression:

Stored size: 712 Bytes

Contents

module Bugsnag::Middleware
  ##
  # Determines if the exception should be ignored based on the configured
  # `ignore_classes`
  #
  # @deprecated Use {DiscardErrorClass} instead
  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

22 entries across 22 versions & 1 rubygems

Version Path
bugsnag-6.27.1 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.26.4 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.26.3 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.26.2 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.26.1 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.26.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.25.2 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.25.1 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.25.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.24.2 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.24.1 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.24.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.23.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.22.1 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.21.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.20.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.19.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.18.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.17.0 lib/bugsnag/middleware/ignore_error_class.rb
bugsnag-6.16.0 lib/bugsnag/middleware/ignore_error_class.rb