Skip to content

Commit

Permalink
Fix JENKINS-15008
Browse files Browse the repository at this point in the history
Make the message clear as to what is missing
  • Loading branch information
slide committed Oct 1, 2012
1 parent 81515ac commit 33dbcc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -38,6 +38,8 @@ public <P extends AbstractProject<P, B>, B extends AbstractBuild<P, B>> String g
String path = Args.get(args, VAR_PATH_NAME, null);
if (path == null) {
throw new IllegalArgumentException("FILE token requires the " + VAR_PATH_NAME + " parameter");
} else if(!build.getWorkspace().child(path).exists()) {
return "ERROR: File '" + path + "' does not exist";
}

try {
Expand Down
Expand Up @@ -28,6 +28,6 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen

WorkspaceFileContent content = new WorkspaceFileContent();
assertEquals("Hello, world!", content.getContent(build, null, null, Collections.singletonMap("path", "foo")));
assertNull(content.getContent(build, null, null, Collections.singletonMap("path", "no-such-file")));
assertEquals("ERROR: File 'no-such-file' does not exist", content.getContent(build, null, null, Collections.singletonMap("path", "no-such-file")));
}
}

0 comments on commit 33dbcc6

Please sign in to comment.