Skip to content

RecoveryInterceptor throw exception for bad request #7558

Answered by dstepanov
o-shevchenko asked this question in Q&A
Discussion options

You must be logged in to vote

According to the documentation https://docs.micronaut.io/latest/guide/#lowLevelClientError

If an HTTP response is returned with a code of 400 or higher, an HttpClientResponseException is created. The exception contains the original response. How that exception gets thrown depends on the return type of the method.

For blocking clients, the exception is thrown and should be caught and handled by the caller. For reactive clients, the exception is passed through the publisher as an error.

It might be a good idea to have some option in @Client(throwOnError = false) to allow receiving HttpResponse when status is >= 400. WDYT @graemerocher @yawkat

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@yawkat
Comment options

@o-shevchenko
Comment options

@dstepanov
Comment options

@o-shevchenko
Comment options

@o-shevchenko
Comment options

Answer selected by o-shevchenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants