Java Spring MVC
When sending invalid requests (broken JSON for example) to the controller endpoint, the response is:
HTTP status 400: "The request sent by the client was syntactically incorrect" this is returned without actually entering the controller action.
since my endpoint is open for 3rd parties I want to override this error code (only this kind of error - not all error codes from the endpoint) and modify it.
Overriding the message is optional but would be a nice addition.
** Explain for the duplicate mark: I know how to set the error code once the request lands in the controller action, the issue i am describing is that the request does not enter the action method since the syntax is incorrect.