You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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()`
The text was updated successfully, but these errors were encountered:
Ah, the problem occurs, while serializing TemplatedEmail before sending it into the bus in Mailer. :)
public function send(RawMessage $message, SmtpEnvelope $envelope = null): void
{
if (null === $this->bus) {
$this->transport->send($message, $envelope);
return;
}
$this->bus->dispatch(new SendEmailMessage($message, $envelope));
}
Serializer is trying to getBody of TemplatedEmail, but the body at this moment is empty, no $html and $text parameters were set yet. So it's another small issue in Mailer.
4.3.2
When
$flattenException
is built from$lastRedeliveryStamp
inSymfony\Component\Messenger\Command\AbstractFailedMessagesCommand:76
it may containsnull
intraceAsString
. Which causes exceptions inSymfony\Component\Messenger\Command\AbstractFailedMessagesCommand:103
, because SymfonyStyle does not like nulls as messages.Actually, I don't know how to simply reproduce this exception.
I got this exception, trying sending
Email
throughMailer
, while generating body inEmail
. (A message must have a text and/or an HTML part.
)As a solution i could recommend the following:
Symfony\Component\Debug\Exception\FlattenException::getTraceAsString
null === $flattenException
in Symfony\Component\Messenger\Command\AbstractFailedMessagesCommand:103, but either check
null === $flattenException->getTraceAsString()`The text was updated successfully, but these errors were encountered: