Skip to content
Browse files
[JENKINS-49237] - Improve diagnosability of JEP-200 exceptions in Bui…
  • Loading branch information
oleg-nenashev committed Jan 30, 2018
1 parent a4f7dd6 commit 0d7a4a928b755d8dedc4c295a252d1242c034fdd
Showing with 8 additions and 3 deletions.
  1. +8 −2 src/main/java/hudson/plugins/helpers/
  2. +0 −1 src/main/java/hudson/plugins/helpers/
@@ -56,6 +56,7 @@ public static boolean doPerform(Ghostwriter ghostwriter,
// construct the BuildProxy instance that we will use

BuildProxy buildProxy = new BuildProxy(
//TODO: It is not compatible with custom artifact managers
new FilePath(build.getArtifactsDir()),
new FilePath(build.getProject().getRootDir()),
new FilePath(build.getRootDir()),
@@ -86,6 +87,7 @@ public static boolean doPerform(Ghostwriter ghostwriter,
|| masterGhostwriter.performFromMaster(build, build.getModuleRoot(), listener);

//TODO: this logic undermines error propagation in the code
* Takes a remote exception that has been wrapped up in the remoting layer, and rethrows it as IOException,
* InterruptedException or if all else fails, a RuntimeException.
@@ -100,15 +102,19 @@ public static boolean doPerform(Ghostwriter ghostwriter,
private static RuntimeException unwrapException(Exception e,
BuildListener listener)
throws IOException, InterruptedException {

if (e.getCause() instanceof IOException) {
throw new IOException2(e.getCause().getMessage(), e);
throw new IOException(e.getCause().getMessage(), e);
if (e.getCause() instanceof InterruptedException) {
throw new InterruptedException(e.getCause().getMessage());
if (e.getCause() instanceof RuntimeException) {
throw new RuntimeException(e.getCause());
RuntimeException ex = new RuntimeException(e.getCause());
// It is required to triage JEP-200 security exceptions
throw ex;
// How on earth do we get this far down the branch
@@ -1,7 +1,6 @@
package hudson.plugins.helpers;

import hudson.model.BuildListener;
import hudson.remoting.Callable;


0 comments on commit 0d7a4a9

Please sign in to comment.