-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module: use more defensive code when handling SWC errors #56646
Conversation
Review requested:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56646 +/- ##
==========================================
- Coverage 89.21% 89.20% -0.02%
==========================================
Files 662 662
Lines 191883 191886 +3
Branches 36941 36932 -9
==========================================
- Hits 171196 171176 -20
- Misses 13536 13547 +11
- Partials 7151 7163 +12
|
Not sure whats the benefit. That path should be unreachable. If it goes into the default it means its a bug or misuse of internals so user should report it. |
Yes exactly, hence the added assertion: if the thrown object is not of the shape we expect, we should throw an assertion fail (the current code assumes it's going to be of a certain shape) |
Which is useful imho because it tells the user to open an issue and allows us to find bugs, while the normal assert is not so descriptive. |
I know, this PR doesn't change that Lines 15 to 20 in 7178588
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Landed in 905e4b4 |
PR-URL: #56646 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #56646 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: James M Snell <[email protected]>
In case the thrown error is not of the shape we expect, we get a
TypeError
but anERR_INTERNAL_ASSERTION