Community
Participate
Working Groups
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.
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