Author: heiko.braun(a)jboss.com
Date: 2008-01-07 12:09:08 -0500 (Mon, 07 Jan 2008)
New Revision: 5409
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/tools/WSTools.java
Log:
Improved error handling and exit codes
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/WSTools.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/WSTools.java 2008-01-07 17:08:13
UTC (rev 5408)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/WSTools.java 2008-01-07 17:09:08
UTC (rev 5409)
@@ -25,6 +25,7 @@
import java.io.File;
import java.io.IOException;
+import java.io.PrintWriter;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.StringTokenizer;
@@ -46,7 +47,7 @@
private static Logger log = Logger.getLogger(WSTools.class);
/**
- * Entry point for the cmd line scripts.
+ * Entry point for the command line scripts.
* Just passes the arguments to
* @see generate(String)
* @param args
@@ -55,7 +56,19 @@
public static void main(String[] args) throws IOException
{
WSTools tools = new WSTools();
- tools.generate(args);
+ boolean success = false;
+ try
+ {
+ success = tools.generate(args);
+ } catch (Throwable e)
+ {
+ e.printStackTrace( new PrintWriter(System.err) );
+ }
+
+ if(success)
+ System.exit(0);
+ else
+ System.exit(1);
}
/**
@@ -148,7 +161,7 @@
}
else
{
- throw new WSException("Nothing done, Configuration source must have
JavaToWSDL or WSDLToJava specified");
+ throw new IOException("Nothing done, Configuration source must have
JavaToWSDL or WSDLToJava specified");
}
return true;
}
Show replies by date