I noticed that the text field reason of this exception did not returned in web response: neither in body, nor in headers.
I ask about it because of the putting the "result code" (enum value) into this field may help in describing the contract of API.
For example this field may contain BAD_COUNTRY or BAD_PHONE_NUMBER in case of processing user's registration form. Both exceptions produce 400 error code.
I checked tomcat and jetty (spring-boot 3.0.1, SpringMVC) - the both do not process this field.
Is it a bug?
Comment From: wilkinsona
Spring Boot's DefaultErrorAttributes will use the reason from a ResponseStatusException as the value of its message. Note that message will only be included in the error response when enabled. This can be done by setting server.error.include-message to always.
If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.