-
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: bugA general bugA general bug
Milestone
Description
Milos Cubrilo opened SPR-16604 and commented
RestTemplate.handleResponse calls ResponseErrorHandler.hasError(response) to check if it should delegate error handling to ResponseErrorHandler instance.
In case of an unknown status code, DefaultResponseErrorHandler.hasError swallows the exception thrown by DefaultResponseErrorHandler.getHttpStatusCode(response) and returns false.
This causes RestTemplate code to proceed with standard response handling, but without possibility to read message body, which has already been consumed during UnknownHttpStatusCodeException creation in DefaultResponseErrorHandler.getHttpStatusCode(response) call.
Affects: 4.3.14
Issue Links:
- RestTemplate doesn't consistently tolerate unknown HTTP status codes [SPR-15978] #20529 RestTemplate doesn't consistently tolerate unknown HTTP status codes
- DefaultResponseErrorHandler.hasError doesn't tolerate unknown status codes [SPR-16108] #20656 DefaultResponseErrorHandler.hasError doesn't tolerate unknown status codes
- DefaultResponseErrorHandler should have its methods protected [SPR-15329] #19892 DefaultResponseErrorHandler should have its methods protected
- DefaultResponseErrorHandler does not handle status values outside of HttpStatus enum [SPR-17461] #21993 DefaultResponseErrorHandler does not handle status values outside of HttpStatus enum
- RestTemplate does not throw exception for custom error codes [SPR-17439] #21971 RestTemplate does not throw exception for custom error codes
Referenced from: pull request #1742, and commits 3b3f27d, d95bbb6
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug