Skip to content

Commit 1c81b98

Browse files
authored
Merge pull request #9030 from shylesh/readfilesync-fix
fix(fs_utils): Ignore only ENOENT in the context of readFileSync
2 parents e6ad7c8 + 69c70ed commit 1c81b98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/fs_utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ function try_read_file_sync(file_name) {
142142
try {
143143
return fs.readFileSync(file_name, 'utf8');
144144
} catch (err) {
145-
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') {
146-
// file does not exist or is not a directory
145+
if (err.code === 'ENOENT') {
146+
// file does not exist
147147
return;
148148
}
149149
throw err;

0 commit comments

Comments
 (0)