Repository navigation
v4.13.0
- Improved Exception Handling
- Don't log 400 Bad Request Stack Trace
Migration Notes
In web.xml replace:
<error-page>
<error-code>500</error-code>
<location>/error</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error</location>
</error-page>
with:
<error-page>
<location>/error</location>
</error-page>
Wrap URL Parameter Conversion/Validation with separate try/catch and send status 400 on error. On GET use:
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
On POST often returning JSON (avoid HTML Error page) so use:
errorReason = "Bad Request";
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
Full Changelog: v4.12.2...v4.13.0