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 4493453931..a55e04ead3 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; } } } 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 e8c1f62e4e..629ccd8269 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 tokens) throws Exception { try { super.execute(tokens); - } catch (Throwable exception) { + } catch (Exception exception) { handleException(exception, jmxServiceUrl.toString()); return; }finally { diff --git a/assembly/src/release/bin/activemq b/assembly/src/release/bin/activemq index c9f86b966f..08cb7bda41 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 }