Skip to content

RestTemplate does not throw exception for custom error codes [SPR-17439] #21971

Closed
@spring-projects-issues

Description

@spring-projects-issues

shollander opened SPR-17439 and commented

Normally, RestTemplate is expected to throw an exception if the server returns an HTTP error code. However, is the server returns a custom error code (4xx or 5xx), no exception is thrown and the call returns normally.


Affects: 4.3.20, 5.0.10

Issue Links:

Referenced from: commits 97ac1c2, 4a51acb, 1c1b942, 738097d

Backported to: 5.0.11, 4.3.21

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions