Skip to content

Commit 28fd362

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: Tweak [Messenger] Add `FlattenExceptionNormalizer`
2 parents d9664c9 + 8797d07 commit 28fd362

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/messenger.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ Here are some important envelope stamps that are shipped with the Symfony Messen
161161
#. :class:`Symfony\\Component\\Messenger\\Stamp\\ErrorDetailsStamp`,
162162
an internal stamp when a message fails due to an exception in the handler.
163163

164+
.. note::
165+
166+
The :class:`Symfony\\Component\\Messenger\\Stamp\\ErrorDetailsStamp` stamp
167+
contains a :class:`Symfony\\Component\\ErrorHandler\\Exception\\FlattenException`,
168+
which is a representation of the exception that made the message fail. You can
169+
get this exception with the
170+
:method:`Symfony\\Component\\Messenger\\Stamp\\ErrorDetailsStamp::getFlattenException`
171+
method. This exception is normalized thanks to the
172+
:class:`Symfony\\Component\\Messenger\\Transport\\Serialization\\Normalizer\\FlattenExceptionNormalizer`
173+
which helps error reporting in the Messenger context.
174+
164175
Instead of dealing directly with the messages in the middleware you receive the envelope.
165176
Hence you can inspect the envelope content and its stamps, or add any::
166177

0 commit comments

Comments
 (0)