Fix for handling error in resttemplate (#17381)

* Fix with handling error

* Fix with handling error
This commit is contained in:
rubiniselvaraj
2023-12-13 10:26:02 +05:30
committed by GitHub
parent 64c85a8fee
commit 4c4388e3c8
8 changed files with 32 additions and 0 deletions

View File

@@ -700,6 +700,10 @@ public class ApiClient extends JavaTimeFormatter {
}
}
if (responseEntity == null) {
throw new RestClientException("API returned HttpServerErrorException");
}
if (responseEntity.getStatusCode().is2xxSuccessful()) {
return responseEntity;
} else {