Fix #753: Remove bogus Java stacktrace highlighting from non-exception output#1194
Open
Anshul-target wants to merge 1 commit intojenkinsci:masterfrom
Open
Conversation
…n-exception output - Only apply 'language-javastacktrace' syntax highlighting to Error Details and Stack Trace fields - Remove highlighting from Standard Output and Standard Error when they contain regular logs - Add conditional logic to detect Java exceptions in stdout/stderr and highlight only when appropriate - Improves UX by preventing API responses, timestamps, and tokens from being highlighted as stack trace
timja
requested changes
Jan 3, 2026
Member
timja
left a comment
There was a problem hiding this comment.
this complexity is not worth it, the highlighted output generally is easier to read anyway... there are some cases where its not the best but mostly I've found it easier
Author
Do i need to make some changes |
iamrajiv
reviewed
Jan 20, 2026
Member
iamrajiv
left a comment
There was a problem hiding this comment.
What about custom exceptions, multi-line stack traces, or system properties containing "Exception"?
| <local:item id="${id}" name="error" title="${%Error Details}" value="${it.errorDetails}" codeClass="language-javastacktrace" /> | ||
| <j:forEach var="p" items="${it.properties}"> | ||
| <local:item id="${id}" name="${p.key}" title="${p.key}" value="${p.value}" /> | ||
| <local:item id="${id}" name="${p.key}" title="${p.key}" value="${p.value}" codeClass="" /> |
Member
There was a problem hiding this comment.
Why hardcode an empty string instead of removing the parameter entirely? This creates unnecessary complexity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
JUnit test output that is not a Java stack trace was getting highlighted as if it were a Java exception. This made normal logs (API responses, timestamps, tokens, plain text) look like stack traces, causing bad UX and confusion.
Solution
language-javastacktracesyntax highlighting to Error Details and Stack Trace fields (which always contain Java exceptions when present)Changes
codeClassparameterTesting
Tested with:
Before
After