We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discard_on
rescue_from
Since version 3.5.1, Rollbar reports errors raised from Action Mailer even if they are handled with discard_on or rescue_from in the delivery job.
In fact, this behavior changed in 3.5.0, but this version fails because of #1145.
require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "rails" gem "rollbar", ENV["ROLLBAR_VERSION"] gem "minitest" end require "rails/all" require "rollbar" require "minitest/autorun" ActiveJob::Base.queue_adapter = :async ActiveJob::Base.queue_adapter.immediate = true Rollbar.configure do |config| config.access_token = "dummy token" end class InactiveRecipientError < StandardError; end class TestDeliveryJob < ActionMailer::MailDeliveryJob discard_on InactiveRecipientError end class TestMailer < ActionMailer::Base self.delivery_job = TestDeliveryJob def mail(to:) raise InactiveRecipientError # simulate error end end class RollbarReportingTest < Minitest::Test def test_rollbar_reports_abort_email_exception TestMailer.mail(to: "[email protected]").deliver_later assert_nil Rollbar.last_report, "Rollbar should not report InactiveRecipientError exception" end end
Save the script to rollbar_actionmailer.rb and run it with:
rollbar_actionmailer.rb
ROLLBAR_VERSION=3.5.1 ruby rollbar_actionmailer.rb
You can also test it with Rollbar in 3.5.0; however, 3.5.0 fails because of #1145.
ROLLBAR_VERSION=3.5.0 ruby rollbar_actionmailer.rb
The InactiveRecipientError error should not be reported, and the test should pass as it does with Rollbar 3.4.2.
InactiveRecipientError
ROLLBAR_VERSION=3.4.2 ruby rollbar_actionmailer.rb
The error is reported even if it is handled by discard_on or rescue_from in the delivery job and the test fails.
The text was updated successfully, but these errors were encountered:
SDK-435 Rollbar reports Action Mailer errors that are handled with `discard_on` and `rescue_from` in the delivery job
Sorry, something went wrong.
No branches or pull requests
Since version 3.5.1, Rollbar reports errors raised from Action Mailer even if they are handled with
discard_on
orrescue_from
in the delivery job.In fact, this behavior changed in 3.5.0, but this version fails because of #1145.
Steps to reproduce
Save the script to
rollbar_actionmailer.rb
and run it with:You can also test it with Rollbar in 3.5.0; however, 3.5.0 fails because of #1145.
Expected behavior
The
InactiveRecipientError
error should not be reported, and the test should pass as it does with Rollbar 3.4.2.Actual behavior
The error is reported even if it is handled by
discard_on
orrescue_from
in the delivery job and the test fails.The text was updated successfully, but these errors were encountered: