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

Function makeException

lib/internal/webidl.js:102–110  ·  view source on GitHub ↗

* Creates the exception thrown by Web IDL converters. * @param {string} message Unprefixed conversion failure message. * @param {ConversionOptions} [options] Conversion options. * @returns {TypeError}

(message, options = kEmptyObject)

Source from the content-addressed store, hash-verified

100 * @returns {TypeError}
101 */
102function makeException(message, options = kEmptyObject) {
103 const prefix = options.prefix ? options.prefix + ': ' : '';
104 const context = options.context?.length === 0 ?
105 '' : (options.context ?? 'Value') + ' ';
106 return codedTypeError(
107 `${prefix}${context}${message}`,
108 options.code || 'ERR_INVALID_ARG_TYPE',
109 );
110}
111
112/**
113 * Builds derived conversion options for nested converter calls and adjusted

Callers 12

toNumberFunction · 0.85
toStringFunction · 0.85
convertToIntFunction · 0.85
webidl.jsFile · 0.85
requiredArgumentsFunction · 0.85
createEnumConverterFunction · 0.85
createSequenceConverterFunction · 0.85
createInterfaceConverterFunction · 0.85

Calls 1

codedTypeErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…