honeybadger-io / honeybadger-ruby

Ruby gem for reporting errors to honeybadger.io
https://docs.honeybadger.io/lib/ruby/
MIT License
251 stars 145 forks source link

ActiveJob `discard_on` reports to Honeybadger #634

Open kylekeesling opened 3 weeks ago

kylekeesling commented 3 weeks ago

I have a few Active Jobs (using solid_queue as the back-end) where I'm using discard_on and noticed that the error is being reported to Honeybadger. Is this the expected/desired behavior?

In my case, I'm using it to just silently throw the job away when a RequestForbiddenError happens (it's an external API call where the user's account may have been deactivated at some point), so I don't really need to be notified.

The Rails docs imply that this is to be used in events where the job is no longer relevant, which in my mind means that you'd also not care to be notified about it.

My preference would be for this not to be reported as an error, but I can also understand an argument the other way, where you'd rather be safe than sorry to report it.

Either way, I just wanted to confirm that this is how you intended it to work before I go a different route in solving the problem, which will likely just be a rescue block that returns nil if the error occurs.

stympy commented 3 weeks ago

I'm pretty sure there was no intended behavior regarding discard_on— I wasn't aware it existed until a couple of days ago ;) — so I'm open to changing how it works.

kylekeesling commented 3 weeks ago

Great to hear, thank you!

If there's something I can do to help, please let me know. I'm not sure how good I am at digging into ActiveJob internals, but I am happy to be of any use.