Feature/java stacktrace exception values#45
Merged
jclausen merged 11 commits intoJul 14, 2026
Merged
Conversation
added 9 commits
July 13, 2026 09:36
… events When showJavaStackTrace=true, the Java stack trace is now parsed into structured Sentry exception values with proper frames (function, filename, lineno, in_app) instead of being dumped as a raw text blob in 'extra'. This gives Sentry proper structured frames for the Java side of the call stack, enabling: - Frame-by-frame navigation in the Sentry UI - Proper exception chaining via 'Caused by:' parsing - Correct grouping and deduplication - in_app heuristics for application vs framework frames The parseJavaStackTrace() method handles: - Standard 'at package.Class.method(File.java:line)' frames - 'Native Method' and 'Unknown Source' frames (no line number) - 'Caused by:' nested exception chains - '... N more' truncated frame indicators Also includes: - Null-safety fix for structifyObject() (from inleague-api patch) - Deprecation of removeTabsOnJavaStackTrace parameter - 7 new test cases covering parsing, in_app detection, Caused by chains, empty TagContext fallback, and edge cases
- Add \r stripping before splitting by \n (regression from old code) - Add jakarta. to in_app exclusion list (Jakarta EE classes) - Add Suppressed: exception handling (Java 7+ suppressed exceptions) - These fix medium-priority issues from code review
… of regex BoxLang's regex engine doesn't handle non-greedy quantifiers and complex patterns reliably. Rewrote parseJavaStackTrace() to use find(), mid(), left() and simple string operations for parsing. This fixes all 5 test failures: - Exception type was including the message (regex not splitting on colon) - Frames array was empty (at-pattern regex not matching) - Caused by chains only producing 2 exceptions instead of 3 - Suppressed exceptions not being parsed Also fixes the upstream test failures caused by BoxLang incompatibility with the old regex-based approach.
BoxLang's reFindNoCase doesn't handle complex regex patterns reliably. Replaced with simple left() prefix checks against a list of framework packages. More readable and guaranteed to work across engines.
1. 'can log Java exception': Use null-safe operator for e.message which is null when catching Java exceptions on both BoxLang and Lucee 2. 'can log exception with no tagContext': Replace 'for (var key in e)' iteration with duplicate()+structDelete() which works on all engines. BoxLang exceptions don't support key iteration like Lucee/ACF.
1. Make prefix checks include the colon: 'Caused by:' and 'Suppressed:' instead of 'Caused by' and 'Suppressed' 2. Simplify last-dot iteration with listToArray/arrayToList instead of manual character loop 3. Fix indentation after removing the if(lastDot>1) block
jclausen
requested changes
Jul 13, 2026
jclausen
left a comment
Contributor
There was a problem hiding this comment.
Some concerns on this one, I would like to see addressed.
1. Gate Java stack trace parsing on TagContext being empty — no need for the overhead when CFML frames are already available 2. Extract duplicated 'Caused by:'/'Suppressed:' parsing into _parseExceptionPrefix() helper function 3. Add test verifying Java traces are skipped when TagContext is present 4. Add .gitignore entries for local server test configs
Author
|
Both comments addressed in the latest commit. Thanks Jon. |
jclausen
requested changes
Jul 14, 2026
jclausen
left a comment
Contributor
There was a problem hiding this comment.
One additional comment around the manual processing. Also looks like all of the Adobe tests are failing with a parameter validation exception for the usage MID in SentryService.cfc
| if ( arguments.showJavaStackTrace && !tagContext.len() && len( arguments.exception.StackTrace ) ) { | ||
| var javaExceptions = parseJavaStackTrace( arguments.exception.StackTrace ); | ||
| for ( var je in javaExceptions ) { | ||
| arrayAppend( sentryException[ "exception" ].values, je ); |
Contributor
There was a problem hiding this comment.
Would it make sense to also populate the tag context, by filtering the lines to .cfc and appending them to the context?
1. Adobe CF requires 3 parameters for mid() — the 2-parameter form (mid(str, start)) is not supported. Added length parameter to all mid() calls in parseJavaStackTrace() and _parseExceptionPrefix(). 2. Fix 'can log exception with no tagContext' test — duplicate(e) fails on Adobe CF because exception objects are Java-backed. Build the struct manually with known keys instead. Both fixes are engine-agnostic and pass on BoxLang 1.15, Lucee 5, and Adobe CF 2021.
Author
|
Adobe tests and exception handling addressed. |
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.
Description
Fix existing boxlang text failures and add support to capture the Java stacktrace as well as the CF stacktrace. Adds tests for java stacktrace support.
Issues
#43
#44
Type of change
Please delete options that are not relevant.
Checklist