Closed
Description
4.3.2
When $flattenException
is built from $lastRedeliveryStamp
in Symfony\Component\Messenger\Command\AbstractFailedMessagesCommand:76
it may contains null
in traceAsString
. Which causes exceptions in Symfony\Component\Messenger\Command\AbstractFailedMessagesCommand:103
, because SymfonyStyle does not like nulls as messages.
$flattenException = null === $lastRedeliveryStamp ? null : $lastRedeliveryStamp->getFlattenException();
$io->title('Exception:');
$io->writeln(null === $flattenException ? '(no data)' : $flattenException->getTraceAsString());
Actually, I don't know how to simply reproduce this exception.
I got this exception, trying sending Email
through Mailer
, while generating body in Email
. (A message must have a text and/or an HTML part.
)
As a solution i could recommend the following:
- Add strong (?string) type-hinting for
Symfony\Component\Debug\Exception\FlattenException::getTraceAsString
- Do check not only for
null === $flattenException
in Symfony\Component\Messenger\Command\AbstractFailedMessagesCommand:103, but either check
null === $flattenException->getTraceAsString()`