Spring Resttemplate exception handling
You want to create a class that implements ResponseErrorHandler and then use an instance of it to set the error handling of your rest template: public class MyErrorHandler implements ResponseErrorHandler { @Override public void handleError(ClientHttpResponse response) throws IOException { // your error handling here } @Override public boolean hasError(ClientHttpResponse response) throws IOException { … } … Read more