ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Fischer <mar...@fischer.name>
Subject Re: Exception in thread doesn't return error code to system
Date Mon, 20 Feb 2006 18:53:37 GMT
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

Mime
View raw message