Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:6.4fromJeroeny:msg-nested-xcp
Oct 1, 2023

Conversation

@Jeroeny
Copy link
Contributor

@JeroenyJeroeny commentedSep 14, 2023
edited
Loading

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?yes
LicenseMIT

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

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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?

@kbond
Copy link
Member

kbond commentedSep 19, 2023
edited
Loading

On the topic of nested exceptions. I'm looking for feedback on#51331 - getting the context of these exceptions. In the case ofHandlerFailedException: what handler threw the exception. Is there a way currently?

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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.

Jeroeny reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas changed the title[Messenger] Add NestedExceptionsInterface for nested exceptions[Messenger] Add WrappedExceptionsInterface for nested exceptionsSep 29, 2023
Copy link
Member

@nicolas-grekasnicolas-grekas left a 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.

@Jeroeny
Copy link
ContributorAuthor

@nicolas-grekas Done. I also changed usages ofHandlerFailedException::getNestedExceptions() togetWrappedExceptions().

@fabpot
Copy link
Member

Thank you@Jeroeny.

@fabpotfabpot merged commit363e217 intosymfony:6.4Oct 1, 2023
fabpot added a commit that referenced this pull requestOct 2, 2023
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
This was referencedOct 21, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@kbondkbondkbond approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@OskarStarkOskarStarkAwaiting requested review from OskarStarkOskarStark is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

5 participants

@Jeroeny@kbond@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp