Login  Register

Re: closing the Exception window

Posted by Ray Schneider on May 13, 2008; 1:59pm
URL: http://imagej.273.s1.nabble.com/closing-the-Exception-window-tp3696237p3696239.html

You probably need to place the plug-in call  in a try block so you can
catch the exception that is thrown.  Just a guess though since I'm
pretty much a newbie when it comes to ImageJ.
I don't know if you can catch exceptions is other ways.
Regards,
Ray
--
Ray Schneider,PE, Ph.D
Assistant Professor
Math and Computer Science
http://www.bridgewater.edu/~rschneid/

John Alexander wrote:

>Hi everyone,
>
>I have a macro that uses a plug in that on occasion throws an Exception.
> It isn't a problem - but I am trying to build in handling for this.
>Right now I have this:
>
>if (isOpen("Exception")) {
>     print("SLD: "+SLD+":   "+SLDdir+SLDname+" threw an exception");
>     selectWindow("Exception");
>     close();
>     }
>
>I get my Log window with my printed statement, but the close() fails by
>saying there is no window "Exception".
>
>any ideas?
>
>
>
>  
>