Re: ErrorHandler
Marco Leal <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.general |
|---|---|
| Organization | MobiComp |
| Message-ID | <[email protected]> |
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
> [email protected]
> 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."