RestTemplate throws IllegalArgumentException when HTTP status is not in the HttpStatus enum [SPR-6752] #11418
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Justin Mills opened SPR-6752 and commented
Using RestTemplate to connect to a server that occasionally throws HTTP Status of 420, I am getting IllegalArgumentExceptions when accessing the HttpStatus object in my implementation of the ResponseErrorHandler interface. When I removed that, and started pulling the status from the Headers directly, RestTemplate started throwing errors due to the logger.warn call in RestTemplate.handleResponseError(). I've gotten around this by not using the HttpStatus enum (getting status from the HttpHeaders directly) and by turning up the log level for RestTemplate to ERROR. Shouldn't this support any HTTP status value?
Affects: 3.0 GA
Issue Links:
Referenced from: commits 68b4c7d
Backported to: 3.0.1
The text was updated successfully, but these errors were encountered: