Closed chonton closed 9 months ago
Maybe same as #310
Hey - sorry for the super-long delay. I switched jobs in the new year, and only get to work on MP Rest Client stuff in my "spare time".
I'm pretty sure that the answer is that the default ResponseExceptionMapper will throw the WebApplicationException - even if the method return type is Response. I agree that that isn't ideal since the client's caller could just handle the Response - whether exception or not.
My only advice to achieve the latter (and probably more desirable) behavior would be to disable the default mapper (either globally or just for certain client interfaces - see the docs for more info: https://download.eclipse.org/microprofile/microprofile-rest-client-2.0/microprofile-rest-client-spec-2.0.html#_default_responseexceptionmapper ) so that no exception will be thrown.
The MP Rest Client group met today and decided not to proceed with further changes based on the above comment from @andymc12 . We are going to close it.
The spec states that when method signature has Response return type, "..., you can receive the entire Response object for parsing the body and header information from the server invocation."
Elsewhere, the Default ResponseExceptionMapper will "map the response into a WebApplicationException whenever the response status code is >= 400".
What is the expected behavior if a method defined as follows returns a 404?
(My personal preference is the latter)