Skip to content

Commit 5155d42

Browse files
committed
throw err instead of originalErr
1 parent 7f0eccd commit 5155d42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/fs/rimraf.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ function _rmdirSync(path, options, originalErr) {
231231
} catch (err) {
232232
if (err.code === 'ENOENT')
233233
return;
234-
if (err.code === 'EACCES' || err.code === 'ENOTDIR')
234+
if (err.code === 'EACCES')
235+
throw err;
236+
if (err.code === 'ENOTDIR')
235237
throw originalErr;
236238

237239
if (notEmptyErrorCodes.has(err.code)) {

0 commit comments

Comments
 (0)