()
| 439 | } |
| 440 | |
| 441 | private getConnectedWebSocket() { |
| 442 | const ws = this.connection?.ws; |
| 443 | if (!ws) { |
| 444 | throw new VaasInvalidStateError("connect() was not called"); |
| 445 | } |
| 446 | if (ws.readyState === WebSocket.WebSocket.CONNECTING) { |
| 447 | throw new VaasInvalidStateError("connect() was not awaited"); |
| 448 | } |
| 449 | if (ws.readyState !== WebSocket.WebSocket.OPEN) { |
| 450 | throw new VaasConnectionClosedError(this.closeEvent); |
| 451 | } |
| 452 | return ws; |
| 453 | } |
| 454 | |
| 455 | private getAuthenticatedWebSocket() { |
| 456 | const ws = this.getConnectedWebSocket(); |
no outgoing calls
no test coverage detected