Skip to content
Advertisement

Tag: controller-advice

Spring ControllerAdvice does not return response body?

I have the following ControllerAdvice, that handles JsonParseException (I use Spring and Jackson) Fore some reason, It doesn’t work when I send a bad json request to the server, only returns 400. When I change the HttpStatus, it still returns 400 so it seems like the advice doesn’t really run. Answer ResponseEntityExceptionHandler already implements a lot of different ExceptionHandlers. HttpMessageNotReadableException

Advertisement