Skip to content

ErrorPageFilter handleException status #4694

@gseifert

Description

@gseifert

When an unhandled exception occurs and the ErrorPageFilter forwards to the error page, the status of the actual response is 200 instead of 500. response.reset() is called and then response.sendError() but the ErrorWrapperResponse overrides sendError() and so the actual response status is still 200. The handleErrorStatus() method calls response.setStatus() with the error status but forwardToErrorPage() does not. So when an ajax call is made for example and an unhandled exception occurs, my ajax success handler is being invoked instead of my ajax error handler since the response status is 200 (OK). When running with the Spring boot plugin and the tomcat embedded container, the response status returned is 500. Should the forwardToErrorPage() method be updated to also call response.setStatus(500)?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions