In Java+Spring application I am using, from a third party called over RestTemplate
, we get the error response in the JSON with 200 response code.
e.g
{
"errors": [{
"reason": "did not like the request",
"error": "BAD_REQUEST"
}]
}
How can I convert BAD_REQUEST
to the 400 integer representations.
Apache HttpStatus
inte does not seem to provide any interface to do so.