tir, 17,.01.2006 kl. 21.07 +1100, skrev Lindsay Steele: > Is there anyway to get the exception page that tapestry displays on an > exception. > > At the moment I intercept the exception and display a custom page to > the user. At the same time I have it send me a mail > that the exception occurred and use my own code to get the cause and > some of the exception. It is not as good as I hoped though. > > I was just wondering if there was an easy way to get the detailed output > that Tapestry usually displays so that I can send that in an email > instead - giving me more information about the exception. >
I just check if it is an ApplicationRuntimeException in my method (in my engine class) : protected void activateExceptionPage(IRequestCycle iRequestCycle, ResponseOutputStream responseOutputStream, Throwable throwable) throws ServletException { ExceptionRethrower exceptionRethrower = (ExceptionRethrower) getBean("exceptionRethrower"); exceptionRethrower.checkForRethrow(throwable); //If we get here, no exceptions was rethrown if(throwable instanceof ApplicationRuntimeException){ ApplicationRuntimeException apr = (ApplicationRuntimeException) throwable; log.error("Error message : "+apr.getMessage()); log.error("Error component : "+apr.getComponent()); log.error("Error location : "+apr.getLocation()); } log.warn("\"Client-side\" exception occured:", throwable); super.activateExceptionPage(iRequestCycle, responseOutputStream, throwable); } Instead of logging it as done in method above, you could put the same information into the email. I guess it might even be possible to render the framework exception-page and put the resulting html into an email as well, that would be even better... HTH Olve
signature.asc
Description: Dette er en digitalt signert meldingsdel