Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353232

Summary: Jetty is unwrapping ServletException and putting the cause in "javax.servlet.error.exception"
Product: [RT] Jetty Reporter: Rafael Cepeda <rafael.cepeda>
Component: serverAssignee: Greg Wilkins <gregw>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: jetty-inbox
Version: 7.3.0   
Target Milestone: 7.5.x   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Rafael Cepeda CLA 2011-07-27 12:57:14 EDT
Jetty is unwrapping ServletException and putting the cause in "javax.servlet.error.exception". So ErrorHandlers cannot correctly identify the original error in this case. For example, throwing (new ServletException(new RuntimeException())) will end up to be identified as an unchecked exception (RuntimeException) instead of a checked one (ServletException). This behavior could affect an ErrorHandler that logs differently depending on the type of exception it gets.
Comment 1 Greg Wilkins CLA 2011-08-29 00:30:35 EDT
Rafael,

a ServletException is not an "Original error", it is just a carrier of the cause exception - which is the original error.   

Jetty has been unwrapping ServletException since the beginning, and no complaints before - so I believe that we have the right action and would be very cautious about changing.

But if you really think that there is a good case to expose the ServletException to the error handling, then please reopen this and explain your reasoning in more detail.

cheers