Re: catching exceptions
Posted by
Robert Dougherty on
URL: http://imagej.273.s1.nabble.com/catching-exceptions-tp3690914p3690916.html
Piotr,
It looks perfect. Thanks!
Bob
On Oct 6, 2009, at 7:27 PM, Piotr Wendykier
<
[hidden email]> wrote:
> Dear Robert,
>
> This is what I do in my plugins:
>
> Thread.setDefaultUncaughtExceptionHandler(new
> UncaughtExceptionHandler() {
> public void uncaughtException(Thread t, Throwable e) {
> StringWriter sw = new StringWriter();
> PrintWriter pw = new PrintWriter(sw, true);
> e.printStackTrace(pw);
> pw.flush();
> sw.flush();
> IJ.log(sw.toString());
> }
> });
>
> Piotr
>
>
>
>>
>>
>>
>>
>>
>>