I have a spring application, restful/mvc with a basic spring controller. Also, internally jackson is used to map the json data into beans. When the client sends bad data say, an extra field is added in the JSON body there the controller returns with a 400 bad request error to the client. This is for post requests. Is there a way to handle the 400 error and capture the error and log it.
Asked
Active
Viewed 153 times
0
-
You can use a custom `ExceptionHandler`. See [this question](http://stackoverflow.com/questions/9045124/how-to-customize-requestparam-error-400-response-in-spring-mvc). – clav May 20 '16 at 22:02
-
The container is masking the actual error message, all I see is 400 bad request in the response. I will try to find the exception – Berlin Brown May 24 '16 at 14:51