I'm using a Spring 5/Spring boot 2.1 REST service application. When our application throws an exception, the response that the client receives by default is this nice JSON string:
{
"timestamp": "2019-03-30T18:18:27Z",
"status": 500,
"error": "Internal Server Error",
"message": "No message available",
"path": "/api/test/"
}
I was wondering which part of Spring (or the underlying Tomcat) is responsible for creating this json message, and when does it occur? I already checked the different HandlerExceptionResolvers (as described here) and don't see it (source code of one is here).
I also implemented a webfilter in the application and when reading out the response body (using the ConcentCachedResponseWrapper to prevent the typical issue of streams only being readable once as decribed here), the response body is always empty.
So that makes me think this json is being created and set on the response AFTER the exception handlers have handled, and AFTER the filters have ran (or at least, my own filter which I didn't specify a special order for).