Skip to content

Commit 07006eb

Browse files
committed
minor #18805 [Messenger] Add FlattenExceptionNormalizer (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] Add `FlattenExceptionNormalizer` Fix #14118 Commits ------- 495b5eb [Messenger] Add `FlattenExceptionNormalizer`
2 parents e7b4ff2 + 495b5eb commit 07006eb

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

components/messenger.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,21 @@ 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 failed. This
169+
exception can be retrieved 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
.. versionadded:: 5.2
165176

166-
The ``ErrorDetailsStamp`` stamp was introduced in Symfony 5.2.
177+
The ``ErrorDetailsStamp`` stamp and the ``FlattenExceptionNormalizer``
178+
were introduced in Symfony 5.2.
167179

168180
Instead of dealing directly with the messages in the middleware you receive the envelope.
169181
Hence you can inspect the envelope content and its stamps, or add any::

0 commit comments

Comments
 (0)