Skip to content

Commit 3645641

Browse files
committed
use getWrappedExceptions method where getNestedExceptions was used
1 parent 325164a commit 3645641

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/Symfony/Bridge/Doctrine/Messenger/DoctrineTransactionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function handleForManager(EntityManagerInterface $entityManager, Envel
3939
if ($exception instanceof HandlerFailedException) {
4040
// Remove all HandledStamp from the envelope so the retry will execute all handlers again.
4141
// When a handler fails, the queries of allegedly successful previous handlers just got rolled back.
42-
throw new HandlerFailedException($exception->getEnvelope()->withoutAll(HandledStamp::class), $exception->getNestedExceptions());
42+
throw new HandlerFailedException($exception->getEnvelope()->withoutAll(HandledStamp::class), $exception->getWrappedExceptions());
4343
}
4444

4545
throw $exception;

src/Symfony/Component/Mailer/Mailer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function send(RawMessage $message, Envelope $envelope = null): void
6565
try {
6666
$this->bus->dispatch(new SendEmailMessage($message, $envelope), $stamps);
6767
} catch (HandlerFailedException $e) {
68-
foreach ($e->getNestedExceptions() as $nested) {
68+
foreach ($e->getWrappedExceptions() as $nested) {
6969
if ($nested instanceof TransportExceptionInterface) {
7070
throw $nested;
7171
}

src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function shouldRetry(\Throwable $e, Envelope $envelope, RetryStrategyInt
128128
// if ALL nested Exceptions are an instance of UnrecoverableExceptionInterface we should not retry
129129
if ($e instanceof HandlerFailedException) {
130130
$shouldNotRetry = true;
131-
foreach ($e->getNestedExceptions() as $nestedException) {
131+
foreach ($e->getWrappedExceptions() as $nestedException) {
132132
if ($nestedException instanceof RecoverableExceptionInterface) {
133133
return true;
134134
}

src/Symfony/Component/Messenger/EventListener/StopWorkerOnCustomStopExceptionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function onMessageFailed(WorkerMessageFailedEvent $event): void
3131
$this->stop = true;
3232
}
3333
if ($th instanceof HandlerFailedException) {
34-
foreach ($th->getNestedExceptions() as $e) {
34+
foreach ($th->getWrappedExceptions() as $e) {
3535
if ($e instanceof StopWorkerExceptionInterface) {
3636
$this->stop = true;
3737
break;

src/Symfony/Component/Notifier/EventListener/SendFailedMessageToNotifierListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public function onMessageFailed(WorkerMessageFailedEvent $event)
4242

4343
$throwable = $event->getThrowable();
4444
if ($throwable instanceof HandlerFailedException) {
45-
$throwable = $throwable->getNestedExceptions()[0];
45+
$exceptions = $throwable->getWrappedExceptions();
46+
$throwable = $exceptions[array_key_first($exceptions)];
4647
}
4748
$envelope = $event->getEnvelope();
4849
$notification = Notification::fromThrowable($throwable)->importance(Notification::IMPORTANCE_HIGH);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy