File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 13
13
use Symfony \Component \Messenger \Event \WorkerMessageHandledEvent ;
14
14
use Symfony \Component \Messenger \Exception \DelayedMessageHandlingException ;
15
15
use Symfony \Component \Messenger \Exception \HandlerFailedException ;
16
+ use Symfony \Component \Messenger \Exception \WrappedExceptionsInterface ;
16
17
use Symfony \Component \Messenger \Stamp \BusNameStamp ;
17
18
18
19
final class MessengerListener
@@ -94,9 +95,11 @@ public function handleWorkerMessageHandledEvent(WorkerMessageHandledEvent $event
94
95
*/
95
96
private function captureException (\Throwable $ exception , bool $ willRetry ): void
96
97
{
97
- if ($ exception instanceof HandlerFailedException) {
98
+ if ($ exception instanceof WrappedExceptionsInterface) {
99
+ $ exception = $ exception ->getWrappedExceptions ();
100
+ } elseif ($ exception instanceof HandlerFailedException && method_exists ($ exception , 'getNestedExceptions ' )) {
98
101
$ exception = $ exception ->getNestedExceptions ();
99
- } elseif ($ exception instanceof DelayedMessageHandlingException) {
102
+ } elseif ($ exception instanceof DelayedMessageHandlingException && method_exists ( $ exception , ' getExceptions ' ) ) {
100
103
$ exception = $ exception ->getExceptions ();
101
104
}
102
105
You can’t perform that action at this time.
0 commit comments