Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce WrapBusinessError interceptor binding #101

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Feb 7, 2025

@mkouba mkouba requested a review from a team as a code owner February 7, 2025 09:09
@mkouba mkouba requested a review from maxandersen February 7, 2025 09:18
@mkouba
Copy link
Contributor Author

mkouba commented Feb 7, 2025

@maxandersen FYI @WrapBusinessError can be declared on a method or on a class. And it wraps all exceptions by default. I'm not so sure about the name but did not find anything better.

@mkouba mkouba changed the title Introduce WrapToolBusinessError interceptor binding Introduce WrapBusinessError interceptor binding Feb 7, 2025
@mkouba mkouba merged commit 95649c2 into quarkiverse:main Feb 7, 2025
1 check passed
@maxandersen
Copy link
Member

How about @WrapOnException ? wether its business or internal is separate concern i feel?

@mkouba
Copy link
Contributor Author

mkouba commented Feb 7, 2025

How about @WrapOnException ? wether its business or internal is separate concern i feel?

Hm, I don't like that. The point is to wrap an exception if it represents a business error. If it doesn't then we don't wrap but log an exception and reply "internal error" to the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide an API to turn any exception thrown in a feature method into a business logic error
2 participants