Skip to content

Commit 380f286

Browse files
committed
fix(browser): uncaught error when stream is destroyed with error
Fixes #1839
1 parent 9fc79df commit 380f286

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/BufferedDuplex.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export class BufferedDuplex extends Duplex {
7979

8080
_destroy(err: Error, callback: (error: Error) => void): void {
8181
this.writeQueue = []
82-
this.proxy.destroy(err)
82+
// do not pass error here otherwise we should listen for `error` event on proxy to prevent uncaught exception
83+
this.proxy.destroy()
8384
callback(err)
8485
}
8586

0 commit comments

Comments
 (0)