diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-20 03:35:39 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-27 20:34:06 +0800 |
commit | 8fb5a6cd81a893dc4929a290206ac0b10c068487 (patch) | |
tree | 6770956b3c36ba06a21372fcc622913eeeedfef8 /lib/fs.js | |
parent | 437c75649335a0b412670b82d3dfc37be7b01d0b (diff) | |
download | android-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.js | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |