Skip to content

Commit 6ca7eb4

Browse files
authored
less strict rmdir error check (#36)
1 parent 8f74a2a commit 6ca7eb4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,7 @@ module.exports = class RandomAccessFile extends RandomAccessStorage {
235235

236236
function onrmdir (err) {
237237
dir = path.join(dir, '..')
238-
239-
const isAlreadyUnlinked = err && err.code === 'ENOENT'
240-
const isNotEmpty = err && err.code === 'ENOTEMPTY'
241-
if (isAlreadyUnlinked || isNotEmpty || dir === root) return req.callback(null)
242-
243-
if (err) return req.callback(err)
238+
if (err || dir === root) return req.callback(null)
244239
fs.rmdir(dir, onrmdir)
245240
}
246241
}

0 commit comments

Comments
 (0)