Skip to content

Commit af042a9

Browse files
eventlistenercletusw
authored andcommitted
Re-throw non-OS errors
1 parent fcd41e3 commit af042a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ function requireUp(filename, cwd) {
2626
try {
2727
return require(filepath);
2828
} catch(error) {
29-
// Ignore (will recurse to parent directory)
29+
// Ignore OS errors (will recurse to parent directory)
30+
if (error.code !== 'MODULE_NOT_FOUND') {
31+
throw error;
32+
}
3033
}
3134

3235
var dir = path.dirname(cwd);

0 commit comments

Comments
 (0)