HttpStatusCodeException - remove HttpStatusCode from message details #34209
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
In terms of DRY (don't repeat yourself), I often feel that Spring adding the
StatusCode
in front of aHttpStatusCodeException
is somehow counter-intuitive. And especially is against DRY, because the statuscode is anyway offered as http status code in the response.Thus, I want to suggest the following test should succeed:
Because as of now, if the HttpStatusCodeException is thrown from a
@RestController
, Spring renders a message like:Source:
HttpStatusCodeException.class
:The text was updated successfully, but these errors were encountered: