You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Erik Price <ep...@ptc.com> on 2003/05/14 17:36:40 UTC

[OT] Re: Custom Exception Handler: how to get exception type?


harm@informatiefabriek.nl wrote:
> <slightly off topic>
> Java does have a method to get the StackTrace as a String just use:
> 
> String blah = e.getStackTrace();
> </slightly off topic>

<even further off topic>
Well, you'd really have to do something pain in the butt like:

StackTraceElement[] elems = e.getStackTrace();
StringBuffer msg = new StringBuffer();
for (int i = 0; i < elems.length; i++) {
   msg.append(elems[i].toString());
}
</even further off topic>


Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org