public boolean service(Request request,
Response response,
RequestHandler handler) throws IOException {
try
{
return handler.service(request, response);
}
catch (IOException ex)
{
// Pass it through.
throw ex;
}
catch (Throwable ex)
{
// Most of the time, we've got exception linked up the kazoo ... but when ClassLoaders
// get involved, things go screwy. Exceptions when transforming classes can cause
// a NoClassDefFoundError with no cause; here we're trying to link the cause back in.
// TAPESTRY-2078
Throwable exceptionToReport = attachNewCause(ex, internalRequestGlobals.getClassLoaderException());
exceptionHandler.handleRequestException(exceptionToReport);
// We assume a reponse has been sent and there's no need to handle the request
// further.
return true;
}
}
|