MCPcopy Create free account
hub / github.com/Streamerbot/client / onError

Method onError

packages/client/src/ws/StreamerbotClient.ts:497–507  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

495 this._reconnectTimeout = setTimeout(
496 async () => {
497 if (!!this.socket && this.socket.readyState !== this.socket.CLOSED) return;
498 this.logger?.debug(`Reconnecting... (attempt ${this._retried})`);
499 try {
500 await this.connect(10_000);
501 } catch (e) {
502 if (this._retried)
503 this.logger?.warn(`Failed to reconnect (attempt ${this._retried - 1})`, e);
504 }
505 },
506 Math.min(30_000, this._retried * 1_000),
507 );
508 } else {
509 this.logger?.debug('Auto-reconnect limit reached. Cleaning up...');
510 this.cleanup();

Callers 3

connectMethod · 0.80
onOpenMethod · 0.80
onCloseMethod · 0.80

Calls 2

debugMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected