-
Notifications
You must be signed in to change notification settings - Fork 30k
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: migrate more fs.*Sync errors into JS land #18348
Conversation
src/node_file.cc
Outdated
&error); | ||
link_path, | ||
encoding, | ||
&error); |
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.
alignment seems off?
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.
@targos Yep, I'll fix that later, thanks for catching. Wondering why the cpp linter didn't catch that..
There is a bug in |
28fa7c5
to
6ce0a1c
Compare
Rebased and updated. CI: https://ci.nodejs.org/job/node-test-pull-request/12771/ |
There was a failure in Just in case, another CI: https://ci.nodejs.org/job/node-test-pull-request/12790/ |
CI failures are unrelated. I can reproduce |
6ce0a1c
to
155319b
Compare
lib/fs.js
Outdated
@@ -1163,7 +1163,13 @@ fs.readlinkSync = function(path, options) { | |||
handleError((path = getPathFromURL(path))); | |||
nullCheck(path); | |||
validatePath(path, 'oldPath'); | |||
return binding.readlink(pathModule.toNamespacedPath(path), options.encoding); | |||
const ctx = { path: path }; |
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.
nit: use shorthand syntax?
The ctx.error is supposed to be handled in fs.readlinkSync, but was handled in fs.symlinkSync by mistake. Also fix the error number check in readlink to be consistent with SYNC_CALL. PR-URL: #18548 Refs: #18348 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#18348 Refs: nodejs#18106 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The ctx.error is supposed to be handled in fs.readlinkSync, but was handled in fs.symlinkSync by mistake. Also fix the error number check in readlink to be consistent with SYNC_CALL. PR-URL: nodejs#18548 Refs: nodejs#18348 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
cc @jasnell
Refs: #18106
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
fs