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

Function getMessage

lib/internal/errors.js:595–618  ·  view source on GitHub ↗
(key, args, self)

Source from the content-addressed store, hash-verified

593}
594
595function getMessage(key, args, self) {
596 const msg = messages.get(key);
597
598 if (typeof msg === 'function') {
599 assert(
600 msg.length <= args.length, // Default options do not count.
601 `Code: ${key}; The provided arguments length (${args.length}) does not ` +
602 `match the required ones (${msg.length}).`,
603 );
604 return ReflectApply(msg, self, args);
605 }
606
607 const expectedLength = getExpectedArgumentLength(msg);
608 assert(
609 expectedLength === args.length,
610 `Code: ${key}; The provided arguments length (${args.length}) does not ` +
611 `match the required ones (${expectedLength}).`,
612 );
613 if (args.length === 0)
614 return msg;
615
616 ArrayPrototypeUnshift(args, msg);
617 return ReflectApply(lazyInternalUtilInspect().format, null, args);
618}
619
620let uvBinding;
621

Callers 4

constructorMethod · 0.85
constructorMethod · 0.85
constructorMethod · 0.85

Calls 4

lazyInternalUtilInspectFunction · 0.85
assertFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…