logo       

Re: ErrorHandler: msg#00009

java.enhydra.general

Subject: Re: ErrorHandler

Hi.

Here's how I do it:

public void run(HttpPresentationComms comms) throws HttpPresentationException {
StringWriter stringWriter = null;
if (comms.exception != null) {
stringWriter = new StringWriter();
comms.exception.printStackTrace(new PrintWriter(stringWriter));
LogChannel logChannel = Enhydra.getLogChannel();
int level = logChannel.getLevel("ERROR");
logChannel.write(level, "ErrorHandler caught an exception - " + comms.exception.getMessage());
logChannel.write(level, "ErrorHandler stack trace = ");
logChannel.write(level, stringWriter.toString());
}
}

Marco.

Thorsten Hilker wrote:

Hi!

If a PO throws an exception the ErrorHandler.po of
the PO's package is called.

Here my question:

Is it possible to access the exception from the
ErrorHandler?
(This would be very useful to generate an expressive
error-page)

TIA

Thorsten

_______________________________________________
Enhydra mailing list
Enhydra@xxxxxxxxxxx
http://www.enhydra.org/mailman/listinfo.cgi/enhydra



--
Marco Leal
MobiComp - Mobile Computing & Wireless Solutions
http://www.mobicomp.com/

"Enjoy your job, make lots of money, work within the law. Choose any two."


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise