From f3502267e5890a0d4bdfc15eb3f56961d090b24f Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Wed, 20 Jan 2010 14:41:43 +0000 Subject: [PATCH] task didn't report build file location when a remote operation failed Bugzilla Report 48578. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@901218 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ .../apache/tools/ant/taskdefs/optional/ssh/Scp.java | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index fd4f66d18..0fd37f8f1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -16,6 +16,9 @@ Fixed bugs: the jarjar links task and protentially other third-party subclasses as well. Bugzilla Report 48541. + + * task didn't report build file location when a remote operation failed + Bugzilla Report 48578. Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java index 8a8dad234..67421d964 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java @@ -235,7 +235,15 @@ public class Scp extends SSHBase { } } catch (Exception e) { if (getFailonerror()) { - throw new BuildException(e); + if(e instanceof BuildException) { + BuildException be = (BuildException) e; + if(be.getLocation() == null) { + be.setLocation(getLocation()); + } + throw be; + } else { + throw new BuildException(e); + } } else { log("Caught exception: " + e.getMessage(), Project.MSG_ERR); }