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

This commit is contained in:
Dejan Bosanac 2015-09-15 11:46:25 +02:00
parent 4f8d56aaf6
commit 32ca1f53fa
3 changed files with 4 additions and 6 deletions

View File

@ -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;
}
}
}

View File

@ -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 {

View File

@ -594,9 +594,6 @@ invoke_task(){
fi
invokeJar "$ACTIVEMQ_PIDFILE"
RET="$?"
if [ "$RET" != "0" ];then
echo "ERROR: task failed"
fi
exit $RET
}