Skip to content

Commit

Permalink
[JENKINS-16444] Diagnostics useful for this and similar exceptions du…
Browse files Browse the repository at this point in the history
…ring Jelly evaluation.
  • Loading branch information
jglick committed Jan 22, 2013
1 parent a1e709d commit 810a395
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/ExpressionFactory2.java
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 810a395

Please sign in to comment.