In JSPs, you may use response.sendError(int code, String message) to return a particular error code (eg 404 for not found) and a message as well.
These messages
The exception part of the ErrorData will only be set if the error page was loaded as a result of an exception and not a response error code.
See the javadoc for sendError on HttpServletResponse. It mentions why you're not seeing the message you passed to sendError (emphasis mine):
Sends an error response to the client using the specified status. The server defaults to creating the response to look like an HTML-formatted server error page containing the specified message, setting the content type to "text/html", leaving cookies and other headers unmodified. If an error-page declaration has been made for the web application corresponding to the status code passed in, it will be served back in preference to the suggested msg parameter.
If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.