-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Customize list of exceptions to unwrap in resteasy-reactive #42089
Comments
/cc @FroMage (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive) |
I think this makes sense |
Is it a custom exception that you want to unwrap? Or something that would make sense in general? |
It makes sense to have this be configurable. |
Oh yeah, I totally agree but I wanted to know the use case as it might be something we want to add as default anyway for better user experience. |
One question I do have however is whether the feature should be enabled by a configuration property or some new annotation. The reason the configuration property (although totally reasonable) can be suboptimal is that the IDE doesn't provide any assistance or validation of the value |
This allows users to configure exceptions whose cause will be checked against exception mappers. This capability already existed in Quarkus REST and was used to map some internal exceptions, but with the new annotation users can opt into the feature for whatever exceptions make sense for their use case. Closes: quarkusio#42089
#42094 is what I have in mind |
This allows users to configure exceptions whose cause will be checked against exception mappers. This capability already existed in Quarkus REST and was used to map some internal exceptions, but with the new annotation users can opt into the feature for whatever exceptions make sense for their use case. Closes: quarkusio#42089
Thank you for the quick and welcoming feedback!
@geoand In our use case, I don't think this would lead to unwanted behaviours. |
Although this might make sense, it is however not how the JAX-RS / Jakarta REST specifies things, so it's best not to make this the default behavior. |
This allows users to configure exceptions whose cause will be checked against exception mappers. This capability already existed in Quarkus REST and was used to map some internal exceptions, but with the new annotation users can opt into the feature for whatever exceptions make sense for their use case. Closes: quarkusio#42089
This allows users to configure exceptions whose cause will be checked against exception mappers. This capability already existed in Quarkus REST and was used to map some internal exceptions, but with the new annotation users can opt into the feature for whatever exceptions make sense for their use case. Closes: quarkusio#42089
Introduce `@UnwrapException` for Quarkus REST
This allows users to configure exceptions whose cause will be checked against exception mappers. This capability already existed in Quarkus REST and was used to map some internal exceptions, but with the new annotation users can opt into the feature for whatever exceptions make sense for their use case. Closes: quarkusio#42089
This allows users to configure exceptions whose cause will be checked against exception mappers. This capability already existed in Quarkus REST and was used to map some internal exceptions, but with the new annotation users can opt into the feature for whatever exceptions make sense for their use case. Closes: quarkusio#42089
Description
Exceptions handling declared via ServerExceptionMapper annotation are not called when the exception is wrapped into another exception.
Looking at quarkus code, it looks like the RuntimeExceptionMapper class is responsible for unwrapping exceptions, but it only unwraps exceptions that are in a predefined list computed at build time via build items.
Example for resteasy reactive extension:
quarkus/extensions/resteasy-reactive/rest/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveScanningProcessor.java
Line 122 in 6619648
I propose to add a configuration property to allow users to customize this list of exceptions to unwrap.
Implementation ideas
No response
The text was updated successfully, but these errors were encountered: