unwrap ExceptionStack in code_ handling#737
Open
vchuravy wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #737 +/- ##
==========================================
+ Coverage 80.43% 80.44% +0.01%
==========================================
Files 25 25
Lines 4866 4869 +3
==========================================
+ Hits 3914 3917 +3
Misses 952 952 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
I never was a big fan of this; |
Member
Author
|
cc: @giordano since it came up in conversation |
f265ca2 to
1d91992
Compare
The error hint tells users to catch the exception as `err` and call `code_typed(err; interactive=true)`, but in the REPL the `err` global is a `Base.ExceptionStack`, and errors from `include`d files are wrapped in `LoadError`, so that advice often fails. Provide `GPUCompiler.unwrap_error` to strip these wrappers and update the hint to use it, instead of committing type piracy on the `InteractiveUtils` reflection functions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1d91992 to
47bf47b
Compare
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.
We inform users to use:
But in the REPL this is often not useful advice since the exception of interest is actually wrapped...
This biggest issue with this PR is that we are technically committing type-piracy, but this improves the UX for working with compiler errors from GPUCompiler a lot.
I think there is a second error type that we can get which is when the error happens in a file that is being
include'd