-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report message from response.sendError(int,String) in BasicErrorController #1762
Comments
I agree. See #1731. Changing the precedence would fix that issue. |
Did you consider making the precedence configurable? As it is now, when using the JSR-303 validations, all the caller gets is a |
@chornyi If you don't like the defaults, you can provide your own |
I don't think using JSR-303 per se will prevent you from seeing detailed field level errors (that's precisely the change we made here), but it might depend on how you are using it, whether that nformation is available at all. In any case I doubt if the change made here would have hidden any information, so reversing the priority wouldn't help you, unless I'm missing something. If you have an issue with the current code, please open a new ticket, anyway, and refer to this one if you need to. |
@dsyer A while ago we implemented using 2.2 and including the message on sending worked very well, later we updated to Spring 2.4 but the message stopped being included in the response, I just verified that it also happens with 2.3. My mistake, i just found that from SB 2.3 that is configurable by "server.error.include-message" parameter. |
There’s not much point in commenting here. If there’s a behaviour change in recent versions it’s probably intentional, but open a new issue if you want to discuss. |
@dsyer they updated their comment as they found the solution in the meantime. It's unrelated to this and a change of visibility in Spring Boot that is documented in the release notes. |
The
BasicErrorController
doesn't look in the request attributes for a message if the exception is non-null, even if the message from the exception was empty or null. Arguably the message fromsendError()
should take precedence over an exception anyway (it's available as a request attribute, according to the servlet spec).The text was updated successfully, but these errors were encountered: