Closed MatTheCat closed 3 years ago
Hi Mathieu.
I've labelled this a feature request.
Would it always be appropriate to trigger a Bugsnag notification on every WorkerMessageFailedEvent
? It seems like there is a retry mechanism designed to allow workers to fail, so potentially we could trigger a notification but then the worker succeed on a retry. I wonder whether we could hook into the failure_transport
and send notifications there. My gut feeling however is that this would be the responsibility of the developer to handle (i.e. implement a failure transport that triggers a Bugsnag notification as well as handling the failed message).
Have you also looked at UnrecoverableMessageHandlingException
? I think if you throw one of these it'll bypass the catch and your exception would reach Bugsnag.
Yep it was a feature request!
WorkerMessageFailedEvent
exposes a willRetry
method; I would except the exception to reach bugsnag when it returns false
. That way you only have one exception if all retries failed.
Released in v1.10.0 🎉
Expected behavior
Exceptions thrown in
MessageHandlerInterface
are catched by theBugsnagListener
.Observed behavior
This isn't the case.
Steps to reproduce
Have a
MessageHandlerInterface
throw an exception.Version
I suspect all versions are impacted though.
Additional information
Every exception thrown inside a message handler is catched by the worker so it can continue working so there is no
kernel.exception
. Instead aWorkerMessageFailedEvent
is dispatched so theBugsnagListener
should also listen to it.