Skip to content
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

Merged

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jan 10, 2025

The deprecation is only for invalid types, it could be confusing the warning show up for an unrelated error.

Refs: #55753

@aduh95 aduh95 added dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. labels Jan 10, 2025
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jan 10, 2025
Copy link
Member

@BridgeAR BridgeAR left a 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.

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.16%. Comparing base (529b56e) to head (6f62176).
Report is 394 commits behind head on main.

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     
Files with missing lines Coverage Δ
lib/fs.js 98.30% <100.00%> (ø)

... and 24 files with indirect coverage changes

@aduh95
Copy link
Contributor Author

aduh95 commented Feb 26, 2025

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.

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).

@aduh95 aduh95 added the review wanted PRs that need reviews. label Feb 26, 2025
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Feb 26, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 26, 2025
@nodejs-github-bot
Copy link
Collaborator

Copy link

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 28, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 28, 2025
@nodejs-github-bot nodejs-github-bot merged commit 48f381d into nodejs:main Feb 28, 2025
93 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 48f381d

@aduh95 aduh95 deleted the fs-existsSync-deprecation-warning branch February 28, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. dont-land-on-v18.x PRs that should not land on the v18.x-staging branch and should not be released in v18.x. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. review wanted PRs that need reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants