You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2015/09/15 11:46:42 UTC

activemq git commit: https://issues.apache.org/jira/browse/AMQ-5956 - propagate exception - helps with AMQ3410Test and AMQ3411Test failures

Repository: activemq
Updated Branches:
  refs/heads/master 4f8d56aaf -> 32ca1f53f


https://issues.apache.org/jira/browse/AMQ-5956 - propagate exception - helps with AMQ3410Test and AMQ3411Test failures


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/32ca1f53
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/32ca1f53
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/32ca1f53

Branch: refs/heads/master
Commit: 32ca1f53fa3c93cefb7ee96aeee2bc5bd898b2ce
Parents: 4f8d56a
Author: Dejan Bosanac <de...@nighttale.net>
Authored: Tue Sep 15 11:46:25 2015 +0200
Committer: Dejan Bosanac <de...@nighttale.net>
Committed: Tue Sep 15 11:46:34 2015 +0200

----------------------------------------------------------------------
 .../org/apache/activemq/console/command/AbstractCommand.java    | 5 +++--
 .../org/apache/activemq/console/command/AbstractJmxCommand.java | 2 +-
 assembly/src/release/bin/activemq                               | 3 ---
 3 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/32ca1f53/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractCommand.java
----------------------------------------------------------------------
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractCommand.java
index 4493453..a55e04e 100644
--- a/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractCommand.java
+++ b/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractCommand.java
@@ -161,7 +161,7 @@ public abstract class AbstractCommand implements Command {
         }
     }
 
-    protected void handleException(Throwable exception, String serviceUrl) {
+    protected void handleException(Exception exception, String serviceUrl) throws Exception {
         Throwable cause = exception.getCause();
         while (true) {
             Throwable next = cause.getCause();
@@ -173,7 +173,8 @@ public abstract class AbstractCommand implements Command {
         if (cause instanceof ConnectException) {
             context.printInfo("Broker not available at: " + serviceUrl);
         } else {
-            context.printException(new RuntimeException("Failed to execute " + getName() + " task. Reason: " + exception));
+            context.printInfo("Failed to execute " + getName() + " task.");
+            throw exception;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/32ca1f53/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
----------------------------------------------------------------------
diff --git a/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java b/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
index e8c1f62..629ccd8 100644
--- a/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
+++ b/activemq-console/src/main/java/org/apache/activemq/console/command/AbstractJmxCommand.java
@@ -386,7 +386,7 @@ public abstract class AbstractJmxCommand extends AbstractCommand {
     public void execute(List<String> tokens) throws Exception {
         try {
             super.execute(tokens);
-        } catch (Throwable exception) {
+        } catch (Exception exception) {
             handleException(exception, jmxServiceUrl.toString());
             return;
         }finally {

http://git-wip-us.apache.org/repos/asf/activemq/blob/32ca1f53/assembly/src/release/bin/activemq
----------------------------------------------------------------------
diff --git a/assembly/src/release/bin/activemq b/assembly/src/release/bin/activemq
index c9f86b9..08cb7bd 100755
--- a/assembly/src/release/bin/activemq
+++ b/assembly/src/release/bin/activemq
@@ -594,9 +594,6 @@ invoke_task(){
     fi
     invokeJar "$ACTIVEMQ_PIDFILE"
     RET="$?"
-    if [ "$RET" != "0" ];then
-       echo "ERROR: task failed"
-    fi
     exit $RET
 }