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