(err: Error)
| 354 | } |
| 355 | |
| 356 | #onSocketError(err: Error): void { |
| 357 | const wasReady = this.#isReady; |
| 358 | this.#isReady = false; |
| 359 | publish(CHANNELS.ERROR, () => ({ |
| 360 | error: err, |
| 361 | origin: 'client', |
| 362 | internal: false, |
| 363 | clientId: this.#clientId |
| 364 | })); |
| 365 | this.emit('error', err); |
| 366 | |
| 367 | if (wasReady) { |
| 368 | publish(CHANNELS.CONNECTION_CLOSED, () => ({ clientId: this.#clientId, reason: 'error', wasConnected: true })); |
| 369 | } |
| 370 | |
| 371 | if (!wasReady || !this.#isOpen || typeof this.#shouldReconnect(0, err) !== 'number') return; |
| 372 | |
| 373 | this.emit('reconnecting'); |
| 374 | this.#connect().catch(() => { |
| 375 | // the error was already emitted, silently ignore it |
| 376 | }); |
| 377 | } |
| 378 | |
| 379 | |
| 380 | write(iterable: Iterable<ReadonlyArray<RedisArgument>>) { |
no test coverage detected