Browse Source

timeout should result in build failure.

PR: 24170
Submitted by:	Edwin Steele <Edwin underscore STEELE at rta dot nsw dot gov dot au>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275583 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
6e9d415e1e
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java

+ 10
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java View File

@@ -209,7 +209,11 @@ public class SSHExec extends SSHBase {
if (thread.isAlive()) {
// ran out of time
thread = null;
log(TIMEOUT_MESSAGE, Project.MSG_ERR);
if (getFailonerror()) {
throw new BuildException(TIMEOUT_MESSAGE);
} else {
log(TIMEOUT_MESSAGE, Project.MSG_ERR);
}
} else {
// completed successfully
if (outputProperty != null) {
@@ -235,7 +239,11 @@ public class SSHExec extends SSHBase {
throw e;
} catch (JSchException e) {
if (e.getMessage().indexOf("session is down") >= 0) {
log(TIMEOUT_MESSAGE, Project.MSG_ERR);
if (getFailonerror()) {
throw new BuildException(TIMEOUT_MESSAGE, e);
} else {
log(TIMEOUT_MESSAGE, Project.MSG_ERR);
}
} else {
if (getFailonerror()) {
throw new BuildException(e);


Loading…
Cancel
Save