Skip to content

Commit

Permalink
[JENKINS-21905] Diagnose the known cause without printing stacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergondza committed Sep 24, 2017
1 parent d3f75a9 commit 7139382
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/main/java/hudson/tasks/ArtifactArchiver.java
Expand Up @@ -24,6 +24,7 @@
package hudson.tasks;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.AbortException;
import hudson.FilePath;
import jenkins.MasterToSlaveFileCallable;
import hudson.Launcher;
Expand Down Expand Up @@ -222,7 +223,7 @@ private void listenerWarnOrError(TaskListener listener, String message) {
}

@Override
public void perform(Run<?,?> build, FilePath ws, Launcher launcher, TaskListener listener) throws InterruptedException {
public void perform(Run<?,?> build, FilePath ws, Launcher launcher, TaskListener listener) throws InterruptedException, AbortException {
if(artifacts.length()==0) {
listener.error(Messages.ArtifactArchiver_NoIncludes());
build.setResult(Result.FAILURE);
Expand Down Expand Up @@ -263,13 +264,13 @@ public void perform(Run<?,?> build, FilePath ws, Launcher launcher, TaskListener
if (!allowEmptyArchive) {
build.setResult(Result.FAILURE);
}
return;
}
} catch (java.nio.file.AccessDeniedException e) {
throw new AbortException(e.toString()); // Message is not enough as that is the filename only
} catch (IOException e) {
Util.displayIOException(e,listener);
Functions.printStackTrace(e, listener.error(Messages.ArtifactArchiver_FailedToArchive(artifacts)));
build.setResult(Result.FAILURE);
return;
}
}

Expand Down

0 comments on commit 7139382

Please sign in to comment.