Skip to content
Permalink
Browse files
[JENKINS-16444] Diagnostics useful for this and similar exceptions du…
…ring Jelly evaluation.
  • Loading branch information
jglick committed Jan 22, 2013
1 parent a1e709d commit 810a3954cc07eb0561ee201d4a1e8efeb41d18a1
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/src/main/java/hudson/ExpressionFactory2.java
@@ -13,6 +13,8 @@
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;

/**
* {@link ExpressionFactory} so that security exception aborts the page rendering.
@@ -74,7 +76,8 @@ public Object evaluate(JellyContext context) {
// let the security exception pass through
throw e;
} catch (Exception e) {
LOGGER.log(Level.WARNING,"Caught exception evaluating: " + expression + ". Reason: " + e, e);
StaplerRequest currentRequest = Stapler.getCurrentRequest();
LOGGER.log(Level.WARNING,"Caught exception evaluating: " + expression + " in " + (currentRequest != null ? currentRequest.getOriginalRequestURI() : "?") + ". Reason: " + e, e);
return null;
} finally {
CURRENT_CONTEXT.set(null);

0 comments on commit 810a395

Please sign in to comment.