@@ -104,7 +104,8 @@ class WebSocketClient {
104104 }
105105 }
106106 for ( const activeConnection of this . activeConnections ) {
107- await activeConnection . endedProm . catch ( ( ) => { } ) ; // Ignore errors here
107+ // Ignore errors here, we only care that it finishes
108+ await activeConnection . endedProm . catch ( ( ) => { } ) ;
108109 }
109110 this . logger . info ( `Destroyed ${ this . constructor . name } ` ) ;
110111 }
@@ -117,7 +118,8 @@ class WebSocketClient {
117118 ) ;
118119 }
119120 for ( const activeConnection of this . activeConnections ) {
120- await activeConnection . endedProm . catch ( ( ) => { } ) ; // Ignore errors here
121+ // Ignore errors here, we only care that it finished
122+ await activeConnection . endedProm . catch ( ( ) => { } ) ;
121123 }
122124 }
123125
@@ -134,14 +136,14 @@ class WebSocketClient {
134136 new Timer ( {
135137 delay : this . connectionTimeoutTime ,
136138 } ) ;
137- void timer . catch ( ( ) => { } ) ;
138- void timer
139- . then ( ( ) => {
139+ void timer . then (
140+ ( ) => {
140141 abortRaceProm . rejectP (
141142 new webSocketErrors . ErrorClientConnectionTimedOut ( ) ,
142143 ) ;
143- } )
144- . catch ( ( ) => { } ) ;
144+ } ,
145+ ( ) => { } , // Ignore cancellation errors
146+ ) ;
145147 const { signal } = ctx ;
146148 let abortHandler : ( ) => void | undefined ;
147149 if ( signal != null ) {
@@ -242,7 +244,8 @@ class WebSocketClient {
242244 // Setting up activeStream map lifecycle
243245 this . activeConnections . add ( webSocketStreamClient ) ;
244246 void webSocketStreamClient . endedProm
245- . catch ( ( ) => { } ) // Ignore errors
247+ // Ignore errors, we only care that it finished
248+ . catch ( ( ) => { } )
246249 . finally ( ( ) => {
247250 this . activeConnections . delete ( webSocketStreamClient ) ;
248251 signal ?. removeEventListener ( 'abort' , abortStream ) ;
0 commit comments