(error)
| 430 | } |
| 431 | |
| 432 | consumerThrow(error) { |
| 433 | if (this.#consumerState !== 'active') return; |
| 434 | this.#consumerState = 'thrown'; |
| 435 | this.#error = error; |
| 436 | this.#cleanup(); |
| 437 | this.#rejectPendingReads(error); |
| 438 | this.#rejectPendingWrites(error); |
| 439 | if (this.#writerState === 'closing' && this.#pendingEnd) { |
| 440 | this.#pendingEnd.reject(error); |
| 441 | this.#pendingEnd = null; |
| 442 | } |
| 443 | // Reject pending drains - the consumer errored |
| 444 | this.#rejectPendingDrains(error); |
| 445 | } |
| 446 | |
| 447 | // =========================================================================== |
| 448 | // Private Methods |
no test coverage detected