diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-19 17:09:41 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-27 20:34:02 +0800 |
commit | 437c75649335a0b412670b82d3dfc37be7b01d0b (patch) | |
tree | 212c8ee5af23b6968745f93b90550deeaef8662f /lib/fs.js | |
parent | e8ec898a7d8169bed73378b5cd4e677adbec16c8 (diff) | |
download | android-node-v8-437c75649335a0b412670b82d3dfc37be7b01d0b.tar.gz android-node-v8-437c75649335a0b412670b82d3dfc37be7b01d0b.tar.bz2 android-node-v8-437c75649335a0b412670b82d3dfc37be7b01d0b.zip |
fs: throw fs.chmodSync 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
@@ -1054,7 +1054,9 @@ fs.chmodSync = function(path, mode) { validatePath(path); mode = modeNum(mode); validateUint32(mode, 'mode'); - return binding.chmod(pathModule.toNamespacedPath(path), mode); + const ctx = { path }; + binding.chmod(pathModule.toNamespacedPath(path), mode, undefined, ctx); + handleErrorFromBinding(ctx); }; if (constants.O_SYMLINK !== undefined) { |