Skip to content
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

Consistent warn logging for handled exceptions [SPR-17178] #21714

Closed
spring-projects-issues opened this issue Aug 14, 2018 · 4 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 14, 2018

Ran Cohen opened SPR-17178 and commented

I had a controller, and a field in the controller marked as Long. I tried using a url with the field being 0.88, and nothing happend.

After extensive debug, I found a Bind exception, and the reason I thought nothing happend is that the class RequestMappingHandlerAdapter in the method invokeHandlerMethod has a try... finally, no catch.

I wasted a few hours trying to figure out what happend.

Please fix it.


Affects: 4.3.14

Issue Links:

Referenced from: commits 8e980d9, 41e6aa6, a409233, bf7fa39, 04141de, 6ea3441, de453ac

Backported to: 4.3.19

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 14, 2018

Juergen Hoeller commented

This is intentional: Exceptions are being propagated to the DispatcherServlet level from there, to be processed by a HandlerExceptionResolver or ultimately propagated to the Servlet container (similar to a regular servlet throwing an exception). I wonder why your bind exception didn't show up in those places?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 14, 2018

Ran Cohen commented

I don't know if that was the problem, but my log level was info, not debug, so I didn't see the exception. 

Exceptions like this should at least be in a warning log, not debug I think.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 14, 2018

Juergen Hoeller commented

Rossen Stoyanchev, what's your take on this? Some of the cases in DefaultHandlerExceptionResolver indeed only lead to a particular HTTP response but not easily noticeable logging on the server side... We have a few warn log cases there already, do we need to cover further ground with those?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 15, 2018

Rossen Stoyanchev commented

I'd expect a response with status 400? In other words the exception was probably handled. That said we do need to ensure consistent warn log messages in DefaultHandlerExceptionResolver..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants