mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5956 - propagate exception - helps with AMQ3410Test and AMQ3411Test failures
This commit is contained in:
parent
4f8d56aaf6
commit
32ca1f53fa
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -594,9 +594,6 @@ invoke_task(){
|
|||
fi
|
||||
invokeJar "$ACTIVEMQ_PIDFILE"
|
||||
RET="$?"
|
||||
if [ "$RET" != "0" ];then
|
||||
echo "ERROR: task failed"
|
||||
fi
|
||||
exit $RET
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue