|
During the development of JSPs and servlets, you may trigger exceptions in the code. At times the resulting output from the exception is what caused the error in the first place, because the server is overriding the original exception to provide some information. You really want to know the underlying cause of the error. The Resin server allows you to access this rootCause exception. Consider the following code:
catch (Exception e) { debug.log(Level.WARNING, e.toString(), e); Throwable rootE = e.getCause(); if (rootE != null) debug.log(Level.WARNING, e.toString(), e); }
This code includes a normal try/catch block that catches all Exception types. The information about the exception will be logged to the Resin logging system.
|