-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
fs: only show deprecation warning when error code matches #56549
fs: only show deprecation warning when error code matches #56549
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all Node.js errors should trigger the warning and only programmer errors in Node.js code should not be caught. Is that correct? We don't yet have such utility method to check that. We could however check for any error code existence. It should not exist on regular programmer errors.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56549 +/- ##
=======================================
Coverage 89.16% 89.16%
=======================================
Files 662 662
Lines 191746 191746
Branches 36902 36901 -1
=======================================
+ Hits 170970 170972 +2
Misses 13632 13632
+ Partials 7144 7142 -2
|
IMO that's a separate issue (IIUC you're complaining about the fact we blindly catch any error, instead of rethrowing non-Node.js ones). What this PR is addressing is that the warning should only appear when there's a ARG_TYPE error (as that's what has been deprecated). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Landed in 48f381d |
The deprecation is only for invalid types, it could be confusing the warning show up for an unrelated error.
Refs: #55753