Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
fix: handle thrown errors (#405)
Browse files Browse the repository at this point in the history
The pipe can throw when errors occur so handle the errors.
  • Loading branch information
achingbrain authored May 17, 2023
1 parent b1ddaa3 commit 57dfaec
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default (common: TestSetup<StreamMuxerFactory>): void => {
direction: 'inbound',
onIncomingStream: (stream) => {
openedStreams++
void pipe(stream, stream)
void pipe(stream, stream).catch(() => {})
}
})

Expand Down Expand Up @@ -124,7 +124,7 @@ export default (common: TestSetup<StreamMuxerFactory>): void => {
direction: 'inbound',
onIncomingStream: (stream) => {
openedStreams++
void pipe(stream, stream)
void pipe(stream, stream).catch(() => {})
}
})

Expand Down Expand Up @@ -193,7 +193,7 @@ export default (common: TestSetup<StreamMuxerFactory>): void => {
const listener = listenerFactory.createStreamMuxer({
direction: 'inbound',
onIncomingStream: (stream) => {
void pipe(stream, stream)
void pipe(stream, stream).catch(() => {})
}
})

Expand Down

0 comments on commit 57dfaec

Please sign in to comment.