Skip to content

Commit

Permalink
Issue #12697 - do not dispatch to error page outside of ServletChannel
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Jan 10, 2025
1 parent c3557ca commit 65495d7
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 596 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@ public boolean errorPageForMethod(String method)
return ERROR_METHODS.contains(method);
}

/**
* Write an error response.
* <p>
* In Servlet implementations of the {@link ErrorHandler}, this method is overridden to signal that
* a sendError should be triggered a when it enters the servlet channel.
* <p>
*
* @param request The request.
* @param response The response.
* @param callback The callback to call when the response is written.
* @param code The error status code.
* @return True if the error response was written.
*/
public boolean writeError(Request request, Response response, Callback callback, int code)
{
Response.writeError(request, response, callback, code);
return true;
}

@Override
public boolean handle(Request request, Response response, Callback callback) throws Exception
{
Expand Down
Loading

0 comments on commit 65495d7

Please sign in to comment.