summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-02-20 03:35:39 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-02-27 20:34:06 +0800
commit8fb5a6cd81a893dc4929a290206ac0b10c068487 (patch)
tree6770956b3c36ba06a21372fcc622913eeeedfef8 /lib/fs.js
parent437c75649335a0b412670b82d3dfc37be7b01d0b (diff)
downloadandroid-node-v8-8fb5a6cd81a893dc4929a290206ac0b10c068487.tar.gz
android-node-v8-8fb5a6cd81a893dc4929a290206ac0b10c068487.tar.bz2
android-node-v8-8fb5a6cd81a893dc4929a290206ac0b10c068487.zip
fs: throw fs.chownSync errors in JS land
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/fs.js')
-rw-r--r--lib/fs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 0d8d8ec4dc..e86360fc1a 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -1124,7 +1124,9 @@ fs.chownSync = function(path, uid, gid) {
validatePath(path);
validateUint32(uid, 'uid');
validateUint32(gid, 'gid');
- return binding.chown(pathModule.toNamespacedPath(path), uid, gid);
+ const ctx = { path };
+ binding.chown(pathModule.toNamespacedPath(path), uid, gid, undefined, ctx);
+ handleErrorFromBinding(ctx);
};
// exported for unit tests, not for public consumption