Hi,

Adam Taft wrote:
> Markus Fischer wrote:
>> I'm not very confident with Java so I wasn't able to figure out how I
>> can signal the shell that an error occurred in this special case.
> 
> Catch the error and then do:
> 
> System.exit(n);
> 
> where n is the error number you want to return to the shell.

I tried being that clever, but it seems that I was trying to catch the
Exception in the wrong place. My code looks like this:

WebServer webserver = new WebServer (port);
webserver.addHandler(handler, object);
webserver.start ();

When the BindException is thrown he's in start() method, putting the
exception block around it doesn't catch it.

I *think* if it would have been thrown there I would have gotten the
right return value on the shell but it isn't.

thanks,
- Markus

Reply via email to