lib/sentry/client.rb in sentry-ruby-5.8.0 vs lib/sentry/client.rb in sentry-ruby-5.9.0

- old
+ new

@@ -74,10 +74,13 @@ # Initializes an Event object with the given exception. Returns `nil` if the exception's class is excluded from reporting. # @param exception [Exception] the exception to be reported. # @param hint [Hash] the hint data that'll be passed to `before_send` callback and the scope's event processors. # @return [Event, nil] def event_from_exception(exception, hint = {}) - return unless @configuration.sending_allowed? && @configuration.exception_class_allowed?(exception) + return unless @configuration.sending_allowed? + + ignore_exclusions = hint.delete(:ignore_exclusions) { false } + return if !ignore_exclusions && !@configuration.exception_class_allowed?(exception) integration_meta = Sentry.integrations[hint[:integration]] ErrorEvent.new(configuration: configuration, integration_meta: integration_meta).tap do |event| event.add_exception_interface(exception)