MCPcopy Create free account
hub / github.com/nodejs/node / onerror

Function onerror

lib/internal/streams/legacy.js:60–66  ·  view source on GitHub ↗
(er)

Source from the content-addressed store, hash-verified

58
59 // Don't leave dangling pipes when there are errors.
60 function onerror(er) {
61 cleanup();
62 // If we removed the last error handler, trigger an unhandled error event.
63 if (this.listenerCount?.('error') === 0) {
64 this.emit('error', er);
65 }
66 }
67
68 prependListener(source, 'error', onerror);
69 prependListener(dest, 'error', onerror);

Callers

nothing calls this directly

Calls 3

listenerCountMethod · 0.80
cleanupFunction · 0.70
emitMethod · 0.45

Tested by

no test coverage detected