[Messenger] Make HandleTrait
unwrap HandlerFailedException
#52300
Labels
8000
HandleTrait
unwrap HandlerFailedException
#52300
Description
The
HandleTrait
allows to use Messenger as a function call by enforcing a single handler being called and returning its result (cf. https://symfony.com/doc/current/messenger.html#getting-results-when-working-with-command-query-buses).Still, if this handler throws an exception it will be wrapped in a
HandlerFailedException
. The latter is useful when multiple handlers are called, but it seems to me it just adds noise when using theHandleTrait
.Would it make sense to make
HandleTrait::handle
catchHandlerFailedException
s and throw the wrapped exception instead?Example
No response
The text was updated successfully, but these errors were encountered: