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
I would using my withHttpInfo(...) method generate from my client interface but not work because a RestClientException is throwed when i receive a 404 for example.
I have override the Error because i want manage ResponseEntity myself
restTemplate.setErrorHandler(newMyErrorResponseHandler());
varmyClient = newApiClient(restTemplate);
//MyHandler@Slf4jpublicclassMyErrorResponseHandlerimplementsResponseErrorHandler {
@OverridepublicbooleanhasError(@NonNullClientHttpResponseresponse) throwsIOException {
log.warn("Error response received from My API: {}", response.getStatusCode().value());
returnfalse;
}
@OverridepublicvoidhandleError(@NonNullClientHttpResponseresponse) throwsIOException {
// Do nothing
}
}
but in the ApiClient, as you can see, a RestClientException it's throwed if the error isn't 2xx (if the resttemplate's error handler had not managed the exception).
I can't override the ApiClient and i can't catch the http status exception everytime i call an API. I need the ResponseEntity object to do the business logic over here.
Describe the solution you'd like
I want manage the ResponseEntity directly instead a RestClientException
The text was updated successfully, but these errors were encountered:
I would using my withHttpInfo(...) method generate from my client interface but not work because a RestClientException is throwed when i receive a 404 for example.
I have override the Error because i want manage ResponseEntity myself
but in the ApiClient, as you can see, a RestClientException it's throwed if the error isn't 2xx (if the resttemplate's error handler had not managed the exception).
I can't override the ApiClient and i can't catch the http status exception everytime i call an API. I need the ResponseEntity object to do the business logic over here.
Describe the solution you'd like
I want manage the ResponseEntity directly instead a RestClientException
The text was updated successfully, but these errors were encountered: