Skip to content

Commit 10fae72

Browse files
authored
node: fix invalid error handler in fileChunkSink (#322)
Co-authored-by: Sebastian Alex <sebastian.alex@saucelabs.com>
1 parent f9890b2 commit 10fae72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/node/src/streams/fileChunkSink.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface FileChunkSinkOptions {
1717
/**
1818
* File system implementation to use.
1919
*/
20-
readonly fs?: NodeFileSystem;
20+
readonly fs: NodeFileSystem;
2121
}
2222

2323
/**
@@ -70,7 +70,7 @@ export class FileChunkSink extends EventEmitter {
7070
private emitDeleteOrDelete(file: fs.WriteStream) {
7171
// If 'delete' event is not handled, delete the file
7272
if (!this.emit('delete', file)) {
73-
(this._options.fs ?? fs).unlink(file.path.toString('utf-8'), () => {
73+
this._options.fs.unlink(file.path.toString('utf-8')).catch(() => {
7474
// Do nothing on error
7575
});
7676
}

0 commit comments

Comments
 (0)