ERR_MULTIPLE_CALLBACK is an Error subclass (eventually) defined here:
|
class NodeError extends Base { |
|
constructor(...args) { |
|
super(getMessage(code, message, args)) |
|
} |
|
toString() { |
|
return `${this.name} [${code}]: ${this.message}` |
|
} |
|
} |
|
Object.defineProperties(NodeError.prototype, { |
|
name: { |
|
value: Base.name, |
|
writable: true, |
|
enumerable: false, |
|
configurable: true |
|
}, |
|
toString: { |
|
value() { |
|
return `${this.name} [${code}]: ${this.message}` |
|
}, |
|
writable: true, |
|
enumerable: false, |
|
configurable: true |
|
} |
|
}) |
|
NodeError.prototype.code = code |
|
NodeError.prototype[kIsNodeError] = true |
|
codes[code] = NodeError |
|
} |
In this line, ERR_MULTIPLE_CALLBACK is called instead of constructed:
|
errorOrDestroy(stream, err !== null && err !== undefined ? err : ERR_MULTIPLE_CALLBACK()) |
I ran into this in a difficult to isolate scenario

ERR_MULTIPLE_CALLBACKis anErrorsubclass (eventually) defined here:readable-stream/lib/ours/errors.js
Lines 70 to 97 in a2e9aed
In this line,
ERR_MULTIPLE_CALLBACKis called instead of constructed:readable-stream/lib/internal/streams/writable.js
Line 594 in a2e9aed
I ran into this in a difficult to isolate scenario