Skip to content

Commit

Permalink
jetty 12.0.x error unwrap servlet exception (#8491)
Browse files Browse the repository at this point in the history
* unwrap servlet exception per default as expected by TCK

Signed-off-by: Olivier Lamy <[email protected]>
  • Loading branch information
olamy authored Sep 3, 2022
1 parent 314c802 commit 0acd7df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private enum PageLookupTechnique

private final Map<String, String> _errorPages = new HashMap<>(); // code or exception to URL
private final List<ErrorCodeRange> _errorPageList = new ArrayList<>(); // list of ErrorCode by range
private boolean _unwrapServletException = false;
private boolean _unwrapServletException = true;

/**
* @return True if ServletException is unwrapped for {@link Dispatcher#ERROR_EXCEPTION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void setUp() throws Exception
_contextHandler.addServlet(new ServletHolder(new ErrorServlet()), "/error/*");

ErrorPageErrorHandler errorHandler = new ErrorPageErrorHandler();
errorHandler.setUnwrapServletException(false);
_contextHandler.setErrorProcessor(errorHandler);
errorHandler.addErrorPage(500, "/error/500");
errorHandler.addErrorPage(IOException.class.getName(), "/error/IOE");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private enum PageLookupTechnique
private final Map<String, String> _errorPages = new HashMap<>(); // code or exception to URL
private final List<ErrorCodeRange> _errorPageList = new ArrayList<>(); // list of ErrorCode by range
protected ServletContext _servletContext;
private boolean _unwrapServletException = false;
private boolean _unwrapServletException = true;

/**
* @return True if ServletException is unwrapped for {@link Dispatcher#ERROR_EXCEPTION}
Expand Down

0 comments on commit 0acd7df

Please sign in to comment.