You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2016/01/18 15:17:14 UTC
incubator-taverna-commandline git commit: print stack trace on
BundleException
Repository: incubator-taverna-commandline
Updated Branches:
refs/heads/master 581554d2d -> 7469f59ba
print stack trace on BundleException
also System.exit() on any Throwable
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/commit/7469f59b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/tree/7469f59b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/diff/7469f59b
Branch: refs/heads/master
Commit: 7469f59ba011960929d997d41464d803b81f2a22
Parents: 581554d
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Mon Jan 18 14:15:16 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Mon Jan 18 14:17:00 2016 +0000
----------------------------------------------------------------------
.../taverna/commandline/TavernaCommandLine.java | 24 ++++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-commandline/blob/7469f59b/taverna-commandline-launcher/src/main/java/org/apache/taverna/commandline/TavernaCommandLine.java
----------------------------------------------------------------------
diff --git a/taverna-commandline-launcher/src/main/java/org/apache/taverna/commandline/TavernaCommandLine.java b/taverna-commandline-launcher/src/main/java/org/apache/taverna/commandline/TavernaCommandLine.java
index 2dbf984..8bc95ba 100644
--- a/taverna-commandline-launcher/src/main/java/org/apache/taverna/commandline/TavernaCommandLine.java
+++ b/taverna-commandline-launcher/src/main/java/org/apache/taverna/commandline/TavernaCommandLine.java
@@ -63,9 +63,11 @@ public class TavernaCommandLine {
*/
public static void main(final String[] args) {
try {
+ System.out.println("Good morning");
CommandLineOptions commandLineOptions = new CommandLineOptionsImpl(args);
if (commandLineOptions.askedForHelp()) {
commandLineOptions.displayHelp();
+ System.exit(0);
} else {
log4jConfiguration.setApplicationConfiguration(applicationConfiguration);
log4jConfiguration.prepareLog4J();
@@ -77,18 +79,26 @@ public class TavernaCommandLine {
context.registerService("org.apache.taverna.commandline.options.CommandLineOptions",
commandLineOptions, null);
osgilauncher.startServices(true);
- if (commandlineBundle == null) {
- System.err.println("Can't locate command line bundle " + COMMANDLINE_BUNDLE_NAME);
- System.exit(1);
- }
+ if (commandlineBundle == null) {
+ System.err.println("Can't locate command line bundle " + COMMANDLINE_BUNDLE_NAME);
+ System.exit(1);
+ }
osgilauncher.startBundle(osgilauncher.installBundle(commandlineBundle.toURI()));
}
} catch (ArgumentsParsingException e) {
- System.out.println(e.getMessage());
+ System.err.println(e.getMessage());
+ System.exit(2);
} catch (InvalidOptionException e) {
- System.out.println(e.getMessage());
+ System.err.println(e.getMessage());
+ System.exit(3);
} catch (BundleException e) {
- System.out.println(e.getMessage());
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ System.exit(4);
+ } catch (Throwable e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ System.exit(5);
}
}