You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a quarkus app with 2 different API: V1 and V2.
V1 is consuming and producing application/xml. We have a global exception handler to handle all the exceptions on it (using @ServerExceptionMapper).
V2 is consuming and producing application/json.
We'd like to handle the exception raised in case of wrong MediaType differently if it's happening on V1 or V2. We have define a local @ServerExceptionMapper directly inside the V2 controller, but the jakarta.ws.rs.NotSupportedException is caught by the global exception handler and not the local one.
Εxception mappers defined in REST endpoint classes will only be called if the exception is thrown in the same class.
Is it an expected behaviour that the local ExceptionMapper is not used in an error occurs in the V2 controller? Is there a way to segregate our ExceptionMappers per controller?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
We have a quarkus app with 2 different API: V1 and V2.
V1 is consuming and producing
application/xml
. We have a global exception handler to handle all the exceptions on it (using@ServerExceptionMapper
).V2 is consuming and producing
application/json
.We'd like to handle the exception raised in case of wrong MediaType differently if it's happening on V1 or V2. We have define a local
@ServerExceptionMapper
directly inside the V2 controller, but thejakarta.ws.rs.NotSupportedException
is caught by the global exception handler and not the local one.I suppose, that's because (https://quarkus.io/guides/rest):
Is it an expected behaviour that the local ExceptionMapper is not used in an error occurs in the V2 controller? Is there a way to segregate our ExceptionMappers per controller?
Thanks for you help!
Beta Was this translation helpful? Give feedback.
All reactions