-
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
Never propagate a WebApplicationException from the client #19630
Conversation
If a call fails on the server it should be treated as an internal server error, it should not be propagating the response back to the original request. Fixes quarkusio#19488
var res = super.unwrapException(t); | ||
if (res instanceof WebApplicationException) { | ||
WebApplicationException webApplicationException = (WebApplicationException) res; | ||
return new ClientWebApplicationException(webApplicationException.getMessage(), webApplicationException, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WebApplicationException
cause should be propagated here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should.
I'm only wondering if it wouldn't be slightly better if webApplication.getCause()
was passed as the cause and not webApplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, it does loose a bit of context as to where the original exception came from (e.g. a filter could directly throw it with no cause.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, let's leave it
If a call fails on the server it should be treated as an internal server
error, it should not be propagating the response back to the original
request.
Fixes #19488