You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2009/05/07 10:19:36 UTC

svn commit: r772543 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java

Author: bodewig
Date: Thu May  7 08:19:29 2009
New Revision: 772543

URL: http://svn.apache.org/viewvc?rev=772543&view=rev
Log:
honor failonerror on connection problems.  PR 46829.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=772543&r1=772542&r2=772543&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu May  7 08:19:29 2009
@@ -367,6 +367,10 @@
    that are already signed.
    Bugzilla Report 46891.
 
+ * <sshexec> now again honors failonerror in the face of connection
+   errors.
+   Bugzilla Report 46829.
+
 Other changes:
 --------------
  * A HostInfo task was added performing information on hosts, including info on 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java?rev=772543&r1=772542&r2=772543&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java Thu May  7 08:19:29 2009
@@ -206,11 +206,20 @@
                     }
                     FileUtils.close(br);
                 } catch (IOException e) {
-                    throw new BuildException(e);
+                    if (getFailonerror()) {
+                        throw new BuildException(e);
+                    } else {
+                        log("Caught exception: " + e.getMessage(),
+                            Project.MSG_ERR);
+                    }
                 }
             }
         } catch (JSchException e) {
-            throw new BuildException(e);
+            if (getFailonerror()) {
+                throw new BuildException(e);
+            } else {
+                log("Caught exception: " + e.getMessage(), Project.MSG_ERR);
+            }
         } finally {
             if (outputProperty != null) {
                 getProject().setNewProperty(outputProperty, output.toString());