MCPcopy Index your code
hub / github.com/nodejs/node / consumerThrow

Method consumerThrow

lib/internal/streams/iter/push.js:432–445  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

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

Callers 1

throwFunction · 0.80

Calls 5

#cleanupMethod · 0.95
#rejectPendingReadsMethod · 0.95
#rejectPendingWritesMethod · 0.95
#rejectPendingDrainsMethod · 0.95
rejectMethod · 0.80

Tested by

no test coverage detected