Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-10762] improve error message if source dir cannot be a…
…ccessed
  • Loading branch information
alanharder committed Aug 31, 2011
1 parent 98a1b9b commit cdf887f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
Expand Up @@ -212,10 +212,12 @@ private boolean perform(Run run, String expandedFilter, FilePath targetDir,
FilePath baseTargetDir, CopyMethod copier, PrintStream console)
throws IOException, InterruptedException {
// Check special case for copying from workspace instead of artifacts:
FilePath srcDir = (selector instanceof WorkspaceSelector && run instanceof AbstractBuild)
? ((AbstractBuild)run).getWorkspace() : new FilePath(run.getArtifactsDir());
boolean useWs = (selector instanceof WorkspaceSelector && run instanceof AbstractBuild);
FilePath srcDir = useWs ? ((AbstractBuild)run).getWorkspace()
: new FilePath(run.getArtifactsDir());
if (srcDir == null || !srcDir.exists()) {
console.println(Messages.CopyArtifact_MissingWorkspace()); // (see JENKINS-3330)
console.println(useWs ? Messages.CopyArtifact_MissingSrcWorkspace() // (see JENKINS-3330)
: Messages.CopyArtifact_MissingSrcArtifacts());
return isOptional(); // Fail build unless copy is optional
}

Expand Down
Expand Up @@ -7,6 +7,8 @@ CopyArtifact.MissingBuild=Unable to find a build for artifact copy from: {0}
CopyArtifact.MissingProject=Unable to find project for artifact copy: {0}\n\
This may be due to incorrect project name or permission settings; \
see help for project name in job configuration.
CopyArtifact.MissingSrcArtifacts=Unable to access upstream artifacts area. Does source project archive artifacts?
CopyArtifact.MissingSrcWorkspace=Unable to access upstream workspace for artifact copy. Slave node offline?
CopyArtifact.MissingWorkspace=Unable to access workspace for artifact copy. Slave node offline?
CopyArtifact.ParameterizedName=Value references a build parameter, so it cannot be validated.
PermalinkBuildSelector.DisplayName=Specified by permalink
Expand Down

0 comments on commit cdf887f

Please sign in to comment.