You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a directory is deleted while it is being globbed with the stream API, an unhandled error event is fired that is not propagated to the returned stream, so it cannot be handled and causes the Node process to crash.
Expected behavior
Any error that happens should be propagated and emitted on the returned stream.
........................................../Users/felix/git/lang-typescript/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:371
throw err;
^
Error: ENOENT: no such file or directory, lstat '/Users/felix/git/test/node_modules/before-after-hook/LICENSE'
Emitted 'error' event at:
at DirectoryReader.emit (/Users/felix/git/lang-typescript/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:365:14)
at stat (/Users/felix/git/lang-typescript/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:181:14)
at call.safe (/Users/felix/git/lang-typescript/node_modules/@mrmlnc/readdir-enhanced/lib/stat.js:22:14)
at onceWrapper (/Users/felix/git/lang-typescript/node_modules/@mrmlnc/readdir-enhanced/lib/call.js:45:17)
at FSReqCallback.oncomplete (fs.js:161:21)
Note how ERROR FIRED is not logged, this error is an unhandled error event that crashes the process.
The text was updated successfully, but these errors were encountered:
Environment
Actual behavior
When a directory is deleted while it is being globbed with the stream API, an unhandled
error
event is fired that is not propagated to the returned stream, so it cannot be handled and causes the Node process to crash.Expected behavior
Any error that happens should be propagated and emitted on the returned stream.
Steps to reproduce
Create a test folder with a lot of files (e.g. a repo with lots of dependencies that are installed into node_modules. I used https://github.com/sourcegraph/lang-typescript)
Run this test file:
Output:
Note how
ERROR FIRED
is not logged, this error is an unhandled error event that crashes the process.The text was updated successfully, but these errors were encountered: