From 63e48ae86517eaa4b15dd5950babd68f4680ed46 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 20 Nov 2009 01:49:03 +0000 Subject: [PATCH] improved the diagnosability. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23882 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/FilePath.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index ada188f94b..19a3684377 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -1261,11 +1261,15 @@ public final class FilePath implements Serializable { * Copies this file to the specified target. */ public void copyTo(FilePath target) throws IOException, InterruptedException { - OutputStream out = target.write(); try { - copyTo(out); - } finally { - out.close(); + OutputStream out = target.write(); + try { + copyTo(out); + } finally { + out.close(); + } + } catch (IOException e) { + throw new IOException2("Failed to copy "+this+" to "+target,e); } } -- GitLab