Skip to content

Commit 0918085

Browse files
committed
Fixed error messages in NotificationEventSubscriber
1 parent b119a9a commit 0918085

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/EventSubscriber/NotificationEventSubscriber.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ private function createErrorNotificationBuilder(string $messageBase, ExceptionIn
256256
{
257257
$notifier = $this->getNotifier();
258258

259-
if ($e instanceof TranslatableException) {
260-
return $notifier->error($messageBase . '.' . $e->getMessage(), $e->getArgs());
259+
if ($e instanceof TranslatableException || $e->getPrevious() instanceof TranslatableException) {
260+
$translatableException = $e instanceof TranslatableException ? $e : $e->getPrevious();
261+
assert($translatableException instanceof TranslatableException);
262+
263+
return $notifier->error($messageBase . '.' . $translatableException->getMessage(), $translatableException->getArgs());
261264
}
262265

263266
return $notifier->error($messageBase . '.default', [

0 commit comments

Comments
 (0)