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] AddUnwrapHandlerExceptionMiddleware#52949

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

Closed
MatTheCat wants to merge2 commits intosymfony:7.1fromMatTheCat:ticket_52300

Conversation

@MatTheCat
Copy link
Contributor

@MatTheCatMatTheCat commentedDec 8, 2023
edited
Loading

QA
Branch?7.1
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#52300
LicenseMIT

In competition with#52952

When usingtheHandleTrait, theHandlerFailedException just adds noise as the wrapped exception is the one we would expect to be thrown.

This PR adds anUnwrapHandlerExceptionMiddleware (idea stolen fromSulu’sUnpackExceptionMiddleware): added to a bus before theHandleMessageMiddleware, it will throw the single exception wrapped in aHandlerFailedException.

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.1" but it seems your PR description refers to branch "7.1 for features".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

MatTheCat reacted with laugh emoji

@carsonbotcarsonbot added this to the7.1 milestoneDec 8, 2023
@MatTheCatMatTheCatforce-pushed theticket_52300 branch 2 times, most recently from7b50f67 to7514be6CompareDecember 8, 2023 16:46
@ro0NL
Copy link
Contributor

ro0NL commentedDec 8, 2023
edited
Loading

When usingthe HandleTrait, the HandlerFailedException just adds noise

why not unwrap from within HandleTrait then?

edit: oh BC -.-, perhaps introduce a new property flag instead 🤔

MatTheCat reacted with thumbs up emoji

@MatTheCatMatTheCatforce-pushed theticket_52300 branch 2 times, most recently from3d72517 to99e8e2bCompareDecember 8, 2023 17:01
@MatTheCat
Copy link
ContributorAuthor

MatTheCat commentedDec 8, 2023
edited
Loading

perhaps introduce a new property flag instead

Will give it a try thanks! The property would only serve as a BC layer so I’m not sure ifhttps://symfony.com/doc/current/contributing/code/bc.html#adding-an-argument-to-a-public-method would apply?

@ro0NL
Copy link
Contributor

ro0NL commentedDec 8, 2023
edited
Loading

adding new private property to traits is allowed :)

it not sure why it would 'serve as a BC layer', it could be just a new feature

if we think it's the better default, then perhaps deprecatingHandleTrait in favor of a newQueryBusTrait is the better way. It would solve ambigious naming, and we could mark the message bus property readonly right away.

I dont like the middleware approach, since it might force users to split their bus into multiple buses. IMHO it breaks the abstraction of$theBus->dispatch($aMessage), and comes with double middleware bookkeeping.

@MatTheCat
Copy link
ContributorAuthor

MatTheCat commentedDec 8, 2023
edited
Loading

adding new private property to traits is allowed :)

Oh indeed I thought you were talking about a new argument forHandleTrait::handle.

it not sure why it would 'serve as a BC layer', it could be just a new feature

AFAIU we first need a way to make the new behavior opt-in (to keep BC), but then remove the old one. The opt-in mechanism would then only serve as a BC layer.

perhaps deprecatingHandleTrait in favor of a newQueryBusTrait is the better way.

Don’t know about that, butQueryBus seems too specific: you could use theHandleTrait to implement a command bus e.g.
Something likeSingleHandlingTrait maybe..?

ro0NL reacted with thumbs up emoji

@MatTheCat
Copy link
ContributorAuthor

@OskarStark@chalasr FYI I also opened#52952 which is an alternative proposed by@ro0NL I find better. Do you have a preference?

@MatTheCat
Copy link
ContributorAuthor

Closing, since there is no traction and a solution is trivial to implement in userland.

@MatTheCatMatTheCat deleted the ticket_52300 branchFebruary 2, 2024 18:43
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@chalasrchalasrchalasr left review comments

Assignees

No one assigned

Projects

None yet

Milestone

7.1

Development

Successfully merging this pull request may close these issues.

[Messenger] MakeHandleTrait unwrapHandlerFailedException

5 participants

@MatTheCat@carsonbot@ro0NL@OskarStark@chalasr

[8]ページ先頭

©2009-2025 Movatter.jp