-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Dmitry Katsubo opened SPR-15511 and commented
There is a need to create a custom exception that contains method (GET, PUT, ...) and URL information in custom ResponseErrorHandler. Currently the only way to add this information to the exception is to catch and re-wrap it into another exception:
RestTemplate restTemplate = new RestTemplate();
restTemplate.setErrorHandler(new MyRestErrorHandler());
String url = "...";
try {
String response = restTemplate.getForEntity(url, String.class);
} catch (MyRestException e) {
throw new MyRestUrlException(HttpMethod.GET, url, e);
}
Consider extending ResponseErrorHandler interface so that the signature is:
void handleError(HttpMethod method, URI url, ClientHttpResponse response) throws IOException;
Affects: 4.3.8
Referenced from: commits 805fcc6
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement