We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c6be91 commit e04224aCopy full SHA for e04224a
src/upgrader.js
@@ -271,10 +271,15 @@ class Upgrader {
271
if (connection && args[1] === 'close' && args[2] && !_timeline.close) {
272
// Wait for close to finish before notifying of the closure
273
(async () => {
274
- if (connection.stat.status === ConnectionStatus.OPEN) {
275
- await connection.close()
+ try {
+ if (connection.stat.status === ConnectionStatus.OPEN) {
276
+ await connection.close()
277
+ }
278
+ } catch (err) {
279
+ log.error(err)
280
+ } finally {
281
+ this.onConnectionEnd(connection)
282
}
- this.onConnectionEnd(connection)
283
})()
284
285
0 commit comments