Unwrap the unnecessary ExecutionExceptions
@@ -2166,7 +2166,7 @@ public final class FilePath implements Serializable {
writing(new File(dest, target));
Util.createSymlink(dest, target, relativePath, TaskListener.NULL);
} catch (InterruptedException x) {
- throw (IOException) new IOException(x.toString()).initCause(x);
+ throw new IOException(x);
}
count.incrementAndGet();
}
@@ -2199,7 +2199,9 @@ public final class FilePath implements Serializable {
future.get();
return future2.get();
} catch (ExecutionException e) {
- throw new IOException(e);
+ Throwable cause = e.getCause();
+ if (cause == null) cause = e;
+ throw new IOException(cause);
}
} else {
// remote -> local copy
@@ -2230,7 +2232,9 @@ public final class FilePath implements Serializable {
try {
return future.get();
} catch (ExecutionException e) {
- throw new IOException(e);
+ Throwable cause = e.getCause();
+ if (cause == null) cause = e;
+ throw new IOException(cause);
}
}
}
