summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-07-24 23:24:16 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-07-24 23:24:16 +0000
commit15261cf2c448e4b1a3e97258c9565410700db0ed (patch)
tree645c50101c3dd511473bb8195fda031f2f54a3c3
parent50b290072e213a7aeb62d6bac5ad4b67a6fc42eb (diff)
Print stack traces to the configured output stream.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@978946 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/samples/launcher-shell/src/main/java/sample/Shell.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/samples/launcher-shell/src/main/java/sample/Shell.java b/sca-java-2.x/trunk/samples/launcher-shell/src/main/java/sample/Shell.java
index 7aecc8a439..3c4d069c17 100644
--- a/sca-java-2.x/trunk/samples/launcher-shell/src/main/java/sample/Shell.java
+++ b/sca-java-2.x/trunk/samples/launcher-shell/src/main/java/sample/Shell.java
@@ -32,6 +32,7 @@ import java.util.HashMap;
import java.util.concurrent.Callable;
import java.io.BufferedReader;
import java.io.PrintWriter;
+import java.io.StringWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;
@@ -150,8 +151,9 @@ public class Shell {
try {
return func.call();
} catch (Exception e) {
- e.printStackTrace();
- return singletonList(e);
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ return singletonList(sw);
}
}