Handle socket error state better

This commit is contained in:
Jon Staab
2025-06-04 20:18:03 -07:00
parent 59db0eda9d
commit fa815ff87a
3 changed files with 11 additions and 4 deletions
+4 -1
View File
@@ -89,7 +89,10 @@ export class Socket extends EventEmitter {
this._ws.onclose = () => {
this._ws = undefined
this._sendQueue.stop()
this.emit(SocketEvent.Status, SocketStatus.Closed, this.url)
if (this.status !== SocketStatus.Error) {
this.emit(SocketEvent.Status, SocketStatus.Closed, this.url)
}
}
this._ws.onmessage = (event: any) => {