Add clickable file reference for thrown exception #57400
Merged
+29
−26
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.
As an OG PHP developer, my brain is trained to parse the exception for a file reference and line number. I was surprised not the see it in the new exception page.
While this does exist on the page, it can be "below the fold". In addition, that file reference is discerned from the stack trace and may not match the "thrown" exception.
This PR adds a clickable file reference for the "thrown" exception. I'm no designer. But I tried to follow the styling found on the rest of the page, while not introducing clutter.
This also includes an optimization to memoize the exception frames calculation using
once()
. This is a relatively expensive operation and this method was already called from multiple components. I've done so in an atomic commit, so it is easily reverted with:git revert 35a2fa0