Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-16047] Scriptler plugin does not show Error/Exceptions…
… anymore
  • Loading branch information
ndeloof committed Dec 5, 2012
1 parent fc9702b commit 3db125c
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -4,6 +4,7 @@
import hudson.model.TaskListener;
import hudson.remoting.DelegatingCallable;

import java.io.PrintStream;
import java.io.PrintWriter;

import jenkins.model.Jenkins;
Expand Down Expand Up @@ -41,22 +42,22 @@ public Object call() throws RuntimeException {
if (cl == null) {
cl = Thread.currentThread().getContextClassLoader();
}
PrintWriter pw = new PrintWriter(listener.getLogger());
PrintStream logger = listener.getLogger();
GroovyShell shell = new GroovyShell(cl);

for (Parameter param : parameters) {
final String paramName = param.getName();
if (PW_PARAM_VARIABLE.equals(paramName)) {
pw.write(Messages.skipParamter(PW_PARAM_VARIABLE));
logger.println(Messages.skipParamter(PW_PARAM_VARIABLE));
} else {
shell.setVariable(paramName, param.getValue());
}
}
shell.setVariable(PW_PARAM_VARIABLE, listener.getLogger());
shell.setVariable(PW_PARAM_VARIABLE, logger);
try {
Object output = shell.evaluate(script);
if (output != null) {
pw.println(Messages.resultPrefix() + " " + output);
logger.println(Messages.resultPrefix() + " " + output);
return output;
} else {
return "";
Expand All @@ -65,7 +66,7 @@ public Object call() throws RuntimeException {
if (failWithException) {
throw new ScriptlerExecutionException(t);
}
t.printStackTrace(pw);
t.printStackTrace(logger);
return Boolean.FALSE;
}
}
Expand Down

1 comment on commit 3db125c

@buildhive
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins » scriptler-plugin #23 UNSTABLE
Looks like this commit caused a build failure
(what's this?)

Please sign in to comment.