Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger] Add WrappedExceptionsInterface for nested exceptions#51653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
faf2883 to4422f6bCompare
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In order to reduce the cost of upgrading, I'd prefer not deprecating anything and instead addNestedExceptionsInterface::getExceptions()
This would mean removing the$recursive argument, but I think this would be legit: flattening the exception hierarchy isn't needed for the interface to be sufficient.
WDYT?
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Exception/NestedExceptionsTrait.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
kbond commentedSep 19, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
On the topic of nested exceptions. I'm looking for feedback on#51331 - getting the context of these exceptions. In the case of |
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Let's replace the "nested" vocabulary by "wrapped" everywhere.
Can you please also account for#51331 and preserve non-numeric keys (using array_merge(_recursive) should do it).
Last but not least, please also add test covering the $class argument.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Exception/DelayedMessageHandlingException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Exception/NestedExceptionsTrait.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Exception/HandlerFailedExceptionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you please rebase? This LGTM after some minor tweaks on my side.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Exception/WrappedExceptionsInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Jeroeny commentedSep 30, 2023
@nicolas-grekas Done. I also changed usages of |
fabpot commentedOct 1, 2023
Thank you@Jeroeny. |
This PR was merged into the 6.4 branch.Discussion----------[Messenger] Fix WrappedExceptionsTrait| Q | A| ------------- | ---| Branch? | 6.4| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets | -| License | MITFixes some minor flaws introduced in#51653Commits-------f7242ca [Messenger] Fix WrappedExceptionsTrait
Uh oh!
There was an error while loading.Please reload this page.
Metric & logging tools often want to measure / log individual exceptions from the messenger. There are currently two exception classes that hold a bunch of collected exceptions from different messages or handlers. It would be nice if there was a single interface to check and call upon when extracting these nested exceptions.
Example usecase:https://github.com/getsentry/sentry-symfony/pull/760/files#diff-da0fb4498178e4866e794b813999618022c327dea59f9277b86a7abf784aeafaR98