{ "source": "doc/api/errors.md", "introduced_in": "v4.0.0", "classes": [ { "textRaw": "Class: Error", "type": "class", "name": "Error", "desc": "

A generic JavaScript Error object that does not denote any specific\ncircumstance of why the error occurred. Error objects capture a "stack trace"\ndetailing the point in the code at which the Error was instantiated, and may\nprovide a text description of the error.

\n

For crypto only, Error objects will include the OpenSSL error stack in a\nseparate property called opensslErrorStack if it is available when the error\nis thrown.

\n

All errors generated by Node.js, including all System and JavaScript errors,\nwill either be instances of, or inherit from, the Error class.

\n", "methods": [ { "textRaw": "Error.captureStackTrace(targetObject[, constructorOpt])", "type": "method", "name": "captureStackTrace", "signatures": [ { "params": [ { "textRaw": "`targetObject` {Object} ", "name": "targetObject", "type": "Object" }, { "textRaw": "`constructorOpt` {Function} ", "name": "constructorOpt", "type": "Function", "optional": true } ] }, { "params": [ { "name": "targetObject" }, { "name": "constructorOpt", "optional": true } ] } ], "desc": "

Creates a .stack property on targetObject, which when accessed returns\na string representing the location in the code at which\nError.captureStackTrace() was called.

\n
const myObject = {};\nError.captureStackTrace(myObject);\nmyObject.stack;  // similar to `new Error().stack`\n
\n

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

\n

The optional constructorOpt argument accepts a function. If given, all frames\nabove constructorOpt, including constructorOpt, will be omitted from the\ngenerated stack trace.

\n

The constructorOpt argument is useful for hiding implementation\ndetails of error generation from an end user. For instance:

\n
function MyError() {\n  Error.captureStackTrace(this, MyError);\n}\n\n// Without passing MyError to captureStackTrace, the MyError\n// frame would show up in the .stack property. By passing\n// the constructor, we omit that frame, and retain all frames below it.\nnew MyError().stack;\n
\n" } ], "properties": [ { "textRaw": "`stackTraceLimit` {number} ", "type": "number", "name": "stackTraceLimit", "desc": "

The Error.stackTraceLimit property specifies the number of stack frames\ncollected by a stack trace (whether generated by new Error().stack or\nError.captureStackTrace(obj)).

\n

The default value is 10 but may be set to any valid JavaScript number. Changes\nwill affect any stack trace captured after the value has been changed.

\n

If set to a non-number value, or set to a negative number, stack traces will\nnot capture any frames.

\n" }, { "textRaw": "`code` {string} ", "type": "string", "name": "code", "desc": "

The error.code property is a string label that identifies the kind of error.\nSee Node.js Error Codes for details about specific codes.

\n" }, { "textRaw": "`message` {string} ", "type": "string", "name": "message", "desc": "

The error.message property is the string description of the error as set by\ncalling new Error(message). The message passed to the constructor will also\nappear in the first line of the stack trace of the Error, however changing\nthis property after the Error object is created may not change the first\nline of the stack trace (for example, when error.stack is read before this\nproperty is changed).

\n
const err = new Error('The message');\nconsole.error(err.message);\n// Prints: The message\n
\n" }, { "textRaw": "`stack` {string} ", "type": "string", "name": "stack", "desc": "

The error.stack property is a string describing the point in the code at which\nthe Error was instantiated.

\n
Error: Things keep happening!\n   at /home/gbusey/file.js:525:2\n   at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)\n   at Actor.<anonymous> (/home/gbusey/actors.js:400:8)\n   at increaseSynergy (/home/gbusey/actors.js:701:6)\n
\n

The first line is formatted as <error class name>: <error message>, and\nis followed by a series of stack frames (each line beginning with "at ").\nEach frame describes a call site within the code that lead to the error being\ngenerated. V8 attempts to display a name for each function (by variable name,\nfunction name, or object method name), but occasionally it will not be able to\nfind a suitable name. If V8 cannot determine a name for the function, only\nlocation information will be displayed for that frame. Otherwise, the\ndetermined function name will be displayed with location information appended\nin parentheses.

\n

Frames are only generated for JavaScript functions. If, for example, execution\nsynchronously passes through a C++ addon function called cheetahify which\nitself calls a JavaScript function, the frame representing the cheetahify call\nwill not be present in the stack traces:

\n
const cheetahify = require('./native-binding.node');\n\nfunction makeFaster() {\n  // cheetahify *synchronously* calls speedy.\n  cheetahify(function speedy() {\n    throw new Error('oh no!');\n  });\n}\n\nmakeFaster();\n// will throw:\n//   /home/gbusey/file.js:6\n//       throw new Error('oh no!');\n//           ^\n//   Error: oh no!\n//       at speedy (/home/gbusey/file.js:6:11)\n//       at makeFaster (/home/gbusey/file.js:5:3)\n//       at Object.<anonymous> (/home/gbusey/file.js:10:1)\n//       at Module._compile (module.js:456:26)\n//       at Object.Module._extensions..js (module.js:474:10)\n//       at Module.load (module.js:356:32)\n//       at Function.Module._load (module.js:312:12)\n//       at Function.Module.runMain (module.js:497:10)\n//       at startup (node.js:119:16)\n//       at node.js:906:3\n
\n

The location information will be one of:

\n\n

The string representing the stack trace is lazily generated when the\nerror.stack property is accessed.

\n

The number of frames captured by the stack trace is bounded by the smaller of\nError.stackTraceLimit or the number of available frames on the current event\nloop tick.

\n

System-level errors are generated as augmented Error instances, which are\ndetailed here.

\n" } ], "signatures": [ { "params": [ { "textRaw": "`message` {string} ", "name": "message", "type": "string" } ], "desc": "

Creates a new Error object and sets the error.message property to the\nprovided text message. If an object is passed as message, the text message\nis generated by calling message.toString(). The error.stack property will\nrepresent the point in the code at which new Error() was called. Stack traces\nare dependent on V8's stack trace API. Stack traces extend only to either\n(a) the beginning of synchronous code execution, or (b) the number of frames\ngiven by the property Error.stackTraceLimit, whichever is smaller.

\n" }, { "params": [ { "name": "message" } ], "desc": "

Creates a new Error object and sets the error.message property to the\nprovided text message. If an object is passed as message, the text message\nis generated by calling message.toString(). The error.stack property will\nrepresent the point in the code at which new Error() was called. Stack traces\nare dependent on V8's stack trace API. Stack traces extend only to either\n(a) the beginning of synchronous code execution, or (b) the number of frames\ngiven by the property Error.stackTraceLimit, whichever is smaller.

\n" } ] }, { "textRaw": "Class: AssertionError", "type": "class", "name": "AssertionError", "desc": "

A subclass of Error that indicates the failure of an assertion. Such errors\ncommonly indicate inequality of actual and expected value.

\n
assert.strictEqual(1, 2);\n// AssertionError [ERR_ASSERTION]: 1 === 2\n
\n" }, { "textRaw": "Class: RangeError", "type": "class", "name": "RangeError", "desc": "

A subclass of Error that indicates that a provided argument was not within the\nset or range of acceptable values for a function; whether that is a numeric\nrange, or outside the set of options for a given function parameter.

\n
require('net').connect(-1);\n// throws "RangeError: "port" option should be >= 0 and < 65536: -1"\n
\n

Node.js will generate and throw RangeError instances immediately as a form\nof argument validation.

\n" }, { "textRaw": "Class: ReferenceError", "type": "class", "name": "ReferenceError", "desc": "

A subclass of Error that indicates that an attempt is being made to access a\nvariable that is not defined. Such errors commonly indicate typos in code, or\nan otherwise broken program.

\n

While client code may generate and propagate these errors, in practice, only V8\nwill do so.

\n
doesNotExist;\n// throws ReferenceError, doesNotExist is not a variable in this program.\n
\n

Unless an application is dynamically generating and running code,\nReferenceError instances should always be considered a bug in the code\nor its dependencies.

\n" }, { "textRaw": "Class: SyntaxError", "type": "class", "name": "SyntaxError", "desc": "

A subclass of Error that indicates that a program is not valid JavaScript.\nThese errors may only be generated and propagated as a result of code\nevaluation. Code evaluation may happen as a result of eval, Function,\nrequire, or vm. These errors are almost always indicative of a broken\nprogram.

\n
try {\n  require('vm').runInThisContext('binary ! isNotOk');\n} catch (err) {\n  // err will be a SyntaxError\n}\n
\n

SyntaxError instances are unrecoverable in the context that created them –\nthey may only be caught by other contexts.

\n" }, { "textRaw": "Class: TypeError", "type": "class", "name": "TypeError", "desc": "

A subclass of Error that indicates that a provided argument is not an\nallowable type. For example, passing a function to a parameter which expects a\nstring would be considered a TypeError.

\n
require('url').parse(() => { });\n// throws TypeError, since it expected a string\n
\n

Node.js will generate and throw TypeError instances immediately as a form\nof argument validation.

\n" } ], "miscs": [ { "textRaw": "Errors", "name": "Errors", "introduced_in": "v4.0.0", "type": "misc", "desc": "

Applications running in Node.js will generally experience four categories of\nerrors:

\n\n

All JavaScript and System errors raised by Node.js inherit from, or are\ninstances of, the standard JavaScript {Error} class and are guaranteed\nto provide at least the properties available on that class.

\n", "miscs": [ { "textRaw": "Error Propagation and Interception", "name": "Error Propagation and Interception", "type": "misc", "desc": "

Node.js supports several mechanisms for propagating and handling errors that\noccur while an application is running. How these errors are reported and\nhandled depends entirely on the type of Error and the style of the API that is\ncalled.

\n

All JavaScript errors are handled as exceptions that immediately generate\nand throw an error using the standard JavaScript throw mechanism. These\nare handled using the try / catch construct provided by the\nJavaScript language.

\n
// Throws with a ReferenceError because z is undefined\ntry {\n  const m = 1;\n  const n = m + z;\n} catch (err) {\n  // Handle the error here.\n}\n
\n

Any use of the JavaScript throw mechanism will raise an exception that\nmust be handled using try / catch or the Node.js process will exit\nimmediately.

\n

With few exceptions, Synchronous APIs (any blocking method that does not\naccept a callback function, such as fs.readFileSync), will use throw\nto report errors.

\n

Errors that occur within Asynchronous APIs may be reported in multiple ways:

\n\n\n
  const fs = require('fs');\n  fs.readFile('a file that does not exist', (err, data) => {\n    if (err) {\n      console.error('There was an error reading the file!', err);\n      return;\n    }\n    // Otherwise handle the data\n  });\n
\n\n

The use of the 'error' event mechanism is most common for stream-based\nand event emitter-based APIs, which themselves represent a series of\nasynchronous operations over time (as opposed to a single operation that may\npass or fail).

\n

For all EventEmitter objects, if an 'error' event handler is not\nprovided, the error will be thrown, causing the Node.js process to report an\nunhandled exception and crash unless either: The domain module is\nused appropriately or a handler has been registered for the\nprocess.on('uncaughtException') event.

\n
const EventEmitter = require('events');\nconst ee = new EventEmitter();\n\nsetImmediate(() => {\n  // This will crash the process because no 'error' event\n  // handler has been added.\n  ee.emit('error', new Error('This will crash'));\n});\n
\n

Errors generated in this way cannot be intercepted using try / catch as\nthey are thrown after the calling code has already exited.

\n

Developers must refer to the documentation for each method to determine\nexactly how errors raised by those methods are propagated.

\n", "miscs": [ { "textRaw": "Error-first callbacks", "name": "Error-first callbacks", "type": "misc", "desc": "

Most asynchronous methods exposed by the Node.js core API follow an idiomatic\npattern referred to as an error-first callback (sometimes referred to as\na Node.js style callback). With this pattern, a callback function is passed\nto the method as an argument. When the operation either completes or an error\nis raised, the callback function is called with\nthe Error object (if any) passed as the first argument. If no error was\nraised, the first argument will be passed as null.

\n
const fs = require('fs');\n\nfunction errorFirstCallback(err, data) {\n  if (err) {\n    console.error('There was an error', err);\n    return;\n  }\n  console.log(data);\n}\n\nfs.readFile('/some/file/that/does-not-exist', errorFirstCallback);\nfs.readFile('/some/file/that/does-exist', errorFirstCallback);\n
\n

The JavaScript try / catch mechanism cannot be used to intercept errors\ngenerated by asynchronous APIs. A common mistake for beginners is to try to\nuse throw inside an error-first callback:

\n
// THIS WILL NOT WORK:\nconst fs = require('fs');\n\ntry {\n  fs.readFile('/some/file/that/does-not-exist', (err, data) => {\n    // mistaken assumption: throwing here...\n    if (err) {\n      throw err;\n    }\n  });\n} catch (err) {\n  // This will not catch the throw!\n  console.error(err);\n}\n
\n

This will not work because the callback function passed to fs.readFile() is\ncalled asynchronously. By the time the callback has been called, the\nsurrounding code (including the try { } catch (err) { } block will have\nalready exited. Throwing an error inside the callback can crash the Node.js\nprocess in most cases. If domains are enabled, or a handler has been\nregistered with process.on('uncaughtException'), such errors can be\nintercepted.

\n" } ] }, { "textRaw": "Exceptions vs. Errors", "name": "Exceptions vs. Errors", "type": "misc", "desc": "

A JavaScript exception is a value that is thrown as a result of an invalid\noperation or as the target of a throw statement. While it is not required\nthat these values are instances of Error or classes which inherit from\nError, all exceptions thrown by Node.js or the JavaScript runtime will be\ninstances of Error.

\n

Some exceptions are unrecoverable at the JavaScript layer. Such exceptions\nwill always cause the Node.js process to crash. Examples include assert()\nchecks or abort() calls in the C++ layer.

\n" }, { "textRaw": "System Errors", "name": "system_errors", "desc": "

System errors are generated when exceptions occur within the program's\nruntime environment. Typically, these are operational errors that occur\nwhen an application violates an operating system constraint such as attempting\nto read a file that does not exist or when the user does not have sufficient\npermissions.

\n

System errors are typically generated at the syscall level: an exhaustive list\nof error codes and their meanings is available by running man 2 intro or\nman 3 errno on most Unices; or online.

\n

In Node.js, system errors are represented as augmented Error objects with\nadded properties.

\n", "classes": [ { "textRaw": "Class: System Error", "type": "class", "name": "System", "properties": [ { "textRaw": "`code` {string} ", "type": "string", "name": "code", "desc": "

The error.code property is a string representing the error code, which is\ntypically E followed by a sequence of capital letters.

\n" }, { "textRaw": "`errno` {string|number} ", "type": "string|number", "name": "errno", "desc": "

The error.errno property is a number or a string.\nThe number is a negative value which corresponds to the error code defined\nin libuv Error handling. See uv-errno.h header file\n(deps/uv/include/uv-errno.h in the Node.js source tree) for details. In case\nof a string, it is the same as error.code.

\n" }, { "textRaw": "`syscall` {string} ", "type": "string", "name": "syscall", "desc": "

The error.syscall property is a string describing the syscall that failed.

\n" }, { "textRaw": "`path` {string} ", "type": "string", "name": "path", "desc": "

When present (e.g. in fs or child_process), the error.path property is a\nstring containing a relevant invalid pathname.

\n" }, { "textRaw": "`address` {string} ", "type": "string", "name": "address", "desc": "

When present (e.g. in net or dgram), the error.address property is a\nstring describing the address to which the connection failed.

\n" }, { "textRaw": "`port` {number} ", "type": "number", "name": "port", "desc": "

When present (e.g. in net or dgram), the error.port property is a number\nrepresenting the connection's port that is not available.

\n" } ] } ], "modules": [ { "textRaw": "Common System Errors", "name": "common_system_errors", "desc": "

This list is not exhaustive, but enumerates many of the common system\nerrors encountered when writing a Node.js program. An exhaustive list may be\nfound here.

\n\n

\n", "type": "module", "displayName": "Common System Errors" } ], "type": "misc", "displayName": "System Errors" }, { "textRaw": "Node.js Error Codes", "name": "node.js_error_codes", "desc": "

\n", "modules": [ { "textRaw": "ERR_ARG_NOT_ITERABLE", "name": "err_arg_not_iterable", "desc": "

An iterable argument (i.e. a value that works with for...of loops) was\nrequired, but not provided to a Node.js API.

\n

\n", "type": "module", "displayName": "ERR_ARG_NOT_ITERABLE" }, { "textRaw": "ERR_ASSERTION", "name": "err_assertion", "desc": "

A special type of error that can be triggered whenever Node.js detects an\nexceptional logic violation that should never occur. These are raised typically\nby the assert module.

\n

\n", "type": "module", "displayName": "ERR_ASSERTION" }, { "textRaw": "ERR_ASYNC_CALLBACK", "name": "err_async_callback", "desc": "

An attempt was made to register something that is not a function as an\nAsyncHooks callback.

\n

\n", "type": "module", "displayName": "ERR_ASYNC_CALLBACK" }, { "textRaw": "ERR_ASYNC_TYPE", "name": "err_async_type", "desc": "

The type of an asynchronous resource was invalid. Note that users are also able\nto define their own types if using the public embedder API.

\n

\n", "type": "module", "displayName": "ERR_ASYNC_TYPE" }, { "textRaw": "ERR_BUFFER_OUT_OF_BOUNDS", "name": "err_buffer_out_of_bounds", "desc": "

An operation outside the bounds of a Buffer was attempted.

\n

\n", "type": "module", "displayName": "ERR_BUFFER_OUT_OF_BOUNDS" }, { "textRaw": "ERR_BUFFER_TOO_LARGE", "name": "err_buffer_too_large", "desc": "

An attempt has been made to create a Buffer larger than the maximum allowed\nsize.

\n

\n", "type": "module", "displayName": "ERR_BUFFER_TOO_LARGE" }, { "textRaw": "ERR_CHILD_CLOSED_BEFORE_REPLY", "name": "err_child_closed_before_reply", "desc": "

A child process was closed before the parent received a reply.

\n

\n", "type": "module", "displayName": "ERR_CHILD_CLOSED_BEFORE_REPLY" }, { "textRaw": "ERR_CONSOLE_WRITABLE_STREAM", "name": "err_console_writable_stream", "desc": "

Console was instantiated without stdout stream, or Console has a\nnon-writable stdout or stderr stream.

\n

\n", "type": "module", "displayName": "ERR_CONSOLE_WRITABLE_STREAM" }, { "textRaw": "ERR_CPU_USAGE", "name": "err_cpu_usage", "desc": "

The native call from process.cpuUsage could not be processed.

\n

\n", "type": "module", "displayName": "ERR_CPU_USAGE" }, { "textRaw": "ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED", "name": "err_crypto_custom_engine_not_supported", "desc": "

A client certificate engine was requested that is not supported by the version\nof OpenSSL being used.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED" }, { "textRaw": "ERR_CRYPTO_ECDH_INVALID_FORMAT", "name": "err_crypto_ecdh_invalid_format", "desc": "

An invalid value for the format argument was passed to the crypto.ECDH()\nclass getPublicKey() method.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_ECDH_INVALID_FORMAT" }, { "textRaw": "ERR_CRYPTO_ENGINE_UNKNOWN", "name": "err_crypto_engine_unknown", "desc": "

An invalid crypto engine identifier was passed to\nrequire('crypto').setEngine().

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_ENGINE_UNKNOWN" }, { "textRaw": "ERR_CRYPTO_FIPS_FORCED", "name": "err_crypto_fips_forced", "desc": "

The --force-fips command-line argument was used but there was an attempt\nto enable or disable FIPS mode in the crypto module.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_FIPS_FORCED" }, { "textRaw": "ERR_CRYPTO_FIPS_UNAVAILABLE", "name": "err_crypto_fips_unavailable", "desc": "

An attempt was made to enable or disable FIPS mode, but FIPS mode was not\navailable.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_FIPS_UNAVAILABLE" }, { "textRaw": "ERR_CRYPTO_HASH_DIGEST_NO_UTF16", "name": "err_crypto_hash_digest_no_utf16", "desc": "

The UTF-16 encoding was used with hash.digest(). While the\nhash.digest() method does allow an encoding argument to be passed in,\ncausing the method to return a string rather than a Buffer, the UTF-16\nencoding (e.g. ucs or utf16le) is not supported.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_HASH_DIGEST_NO_UTF16" }, { "textRaw": "ERR_CRYPTO_HASH_FINALIZED", "name": "err_crypto_hash_finalized", "desc": "

hash.digest() was called multiple times. The hash.digest() method must\nbe called no more than one time per instance of a Hash object.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_HASH_FINALIZED" }, { "textRaw": "ERR_CRYPTO_HASH_UPDATE_FAILED", "name": "err_crypto_hash_update_failed", "desc": "

hash.update() failed for any reason. This should rarely, if ever, happen.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_HASH_UPDATE_FAILED" }, { "textRaw": "ERR_CRYPTO_INVALID_DIGEST", "name": "err_crypto_invalid_digest", "desc": "

An invalid crypto digest algorithm was specified.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_INVALID_DIGEST" }, { "textRaw": "ERR_CRYPTO_SIGN_KEY_REQUIRED", "name": "err_crypto_sign_key_required", "desc": "

A signing key was not provided to the sign.sign() method.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_SIGN_KEY_REQUIRED" }, { "textRaw": "ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH", "name": "err_crypto_timing_safe_equal_length", "desc": "

crypto.timingSafeEqual() was called with Buffer, TypedArray, or\nDataView arguments of different lengths.

\n

\n", "type": "module", "displayName": "ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH" }, { "textRaw": "ERR_DNS_SET_SERVERS_FAILED", "name": "err_dns_set_servers_failed", "desc": "

c-ares failed to set the DNS server.

\n

\n", "type": "module", "displayName": "ERR_DNS_SET_SERVERS_FAILED" }, { "textRaw": "ERR_DOMAIN_CALLBACK_NOT_AVAILABLE", "name": "err_domain_callback_not_available", "desc": "

The domain module was not usable since it could not establish the required\nerror handling hooks, because\nprocess.setUncaughtExceptionCaptureCallback() had been called at an\nearlier point in time.

\n

\n", "type": "module", "displayName": "ERR_DOMAIN_CALLBACK_NOT_AVAILABLE" }, { "textRaw": "ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE", "name": "err_domain_cannot_set_uncaught_exception_capture", "desc": "

process.setUncaughtExceptionCaptureCallback() could not be called\nbecause the domain module has been loaded at an earlier point in time.

\n

The stack trace is extended to include the point in time at which the\ndomain module had been loaded.

\n

\n", "type": "module", "displayName": "ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE" }, { "textRaw": "ERR_ENCODING_INVALID_ENCODED_DATA", "name": "err_encoding_invalid_encoded_data", "desc": "

Data provided to util.TextDecoder() API was invalid according to the encoding\nprovided.

\n

\n", "type": "module", "displayName": "ERR_ENCODING_INVALID_ENCODED_DATA" }, { "textRaw": "ERR_ENCODING_NOT_SUPPORTED", "name": "err_encoding_not_supported", "desc": "

Encoding provided to util.TextDecoder() API was not one of the\nWHATWG Supported Encodings.

\n

\n", "type": "module", "displayName": "ERR_ENCODING_NOT_SUPPORTED" }, { "textRaw": "ERR_FALSY_VALUE_REJECTION", "name": "err_falsy_value_rejection", "desc": "

A Promise that was callbackified via util.callbackify() was rejected with a\nfalsy value.

\n

\n", "type": "module", "displayName": "ERR_FALSY_VALUE_REJECTION" }, { "textRaw": "ERR_HTTP_HEADERS_SENT", "name": "err_http_headers_sent", "desc": "

An attempt was made to add more headers after the headers had already been sent.

\n

\n", "type": "module", "displayName": "ERR_HTTP_HEADERS_SENT" }, { "textRaw": "ERR_HTTP_INVALID_CHAR", "name": "err_http_invalid_char", "desc": "

An invalid character was found in an HTTP response status message (reason\nphrase).

\n

\n", "type": "module", "displayName": "ERR_HTTP_INVALID_CHAR" }, { "textRaw": "ERR_HTTP_INVALID_STATUS_CODE", "name": "err_http_invalid_status_code", "desc": "

Status code was outside the regular status code range (100-999).

\n

\n", "type": "module", "displayName": "ERR_HTTP_INVALID_STATUS_CODE" }, { "textRaw": "ERR_HTTP_TRAILER_INVALID", "name": "err_http_trailer_invalid", "desc": "

The Trailer header was set even though the transfer encoding does not support\nthat.

\n

\n", "type": "module", "displayName": "ERR_HTTP_TRAILER_INVALID" }, { "textRaw": "ERR_HTTP2_ALREADY_SHUTDOWN", "name": "err_http2_already_shutdown", "desc": "

Occurs with multiple attempts to shutdown an HTTP/2 session.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_ALREADY_SHUTDOWN" }, { "textRaw": "ERR_HTTP2_ALTSVC_INVALID_ORIGIN", "name": "err_http2_altsvc_invalid_origin", "desc": "

HTTP/2 ALTSVC frames require a valid origin.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_ALTSVC_INVALID_ORIGIN" }, { "textRaw": "ERR_HTTP2_ALTSVC_LENGTH", "name": "err_http2_altsvc_length", "desc": "

HTTP/2 ALTSVC frames are limited to a maximum of 16,382 payload bytes.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_ALTSVC_LENGTH" }, { "textRaw": "ERR_HTTP2_CONNECT_AUTHORITY", "name": "err_http2_connect_authority", "desc": "

For HTTP/2 requests using the CONNECT method, the :authority pseudo-header\nis required.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_CONNECT_AUTHORITY" }, { "textRaw": "ERR_HTTP2_CONNECT_PATH", "name": "err_http2_connect_path", "desc": "

For HTTP/2 requests using the CONNECT method, the :path pseudo-header is\nforbidden.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_CONNECT_PATH" }, { "textRaw": "ERR_HTTP2_CONNECT_SCHEME", "name": "err_http2_connect_scheme", "desc": "

For HTTP/2 requests using the CONNECT method, the :scheme pseudo-header is\nforbidden.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_CONNECT_SCHEME" }, { "textRaw": "ERR_HTTP2_FRAME_ERROR", "name": "err_http2_frame_error", "desc": "

A failure occurred sending an individual frame on the HTTP/2 session.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_FRAME_ERROR" }, { "textRaw": "ERR_HTTP2_GOAWAY_SESSION", "name": "err_http2_goaway_session", "desc": "

New HTTP/2 Streams may not be opened after the Http2Session has received a\nGOAWAY frame from the connected peer.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_GOAWAY_SESSION" }, { "textRaw": "ERR_HTTP2_HEADER_REQUIRED", "name": "err_http2_header_required", "desc": "

A required header was missing in an HTTP/2 message.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_HEADER_REQUIRED" }, { "textRaw": "ERR_HTTP2_HEADER_SINGLE_VALUE", "name": "err_http2_header_single_value", "desc": "

Multiple values were provided for an HTTP/2 header field that was required to\nhave only a single value.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_HEADER_SINGLE_VALUE" }, { "textRaw": "ERR_HTTP2_HEADERS_AFTER_RESPOND", "name": "err_http2_headers_after_respond", "desc": "

An additional headers was specified after an HTTP/2 response was initiated.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_HEADERS_AFTER_RESPOND" }, { "textRaw": "ERR_HTTP2_HEADERS_OBJECT", "name": "err_http2_headers_object", "desc": "

An HTTP/2 Headers Object was expected.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_HEADERS_OBJECT" }, { "textRaw": "ERR_HTTP2_HEADERS_SENT", "name": "err_http2_headers_sent", "desc": "

An attempt was made to send multiple response headers.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_HEADERS_SENT" }, { "textRaw": "ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND", "name": "err_http2_info_headers_after_respond", "desc": "

HTTP/2 Informational headers must only be sent prior to calling the\nHttp2Stream.prototype.respond() method.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND" }, { "textRaw": "ERR_HTTP2_INFO_STATUS_NOT_ALLOWED", "name": "err_http2_info_status_not_allowed", "desc": "

Informational HTTP status codes (1xx) may not be set as the response status\ncode on HTTP/2 responses.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INFO_STATUS_NOT_ALLOWED" }, { "textRaw": "ERR_HTTP2_INVALID_CONNECTION_HEADERS", "name": "err_http2_invalid_connection_headers", "desc": "

HTTP/1 connection specific headers are forbidden to be used in HTTP/2\nrequests and responses.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_CONNECTION_HEADERS" }, { "textRaw": "ERR_HTTP2_INVALID_HEADER_VALUE", "name": "err_http2_invalid_header_value", "desc": "

An invalid HTTP/2 header value was specified.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_HEADER_VALUE" }, { "textRaw": "ERR_HTTP2_INVALID_INFO_STATUS", "name": "err_http2_invalid_info_status", "desc": "

An invalid HTTP informational status code has been specified. Informational\nstatus codes must be an integer between 100 and 199 (inclusive).

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_INFO_STATUS" }, { "textRaw": "ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH", "name": "err_http2_invalid_packed_settings_length", "desc": "

Input Buffer and Uint8Array instances passed to the\nhttp2.getUnpackedSettings() API must have a length that is a multiple of\nsix.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH" }, { "textRaw": "ERR_HTTP2_INVALID_PSEUDOHEADER", "name": "err_http2_invalid_pseudoheader", "desc": "

Only valid HTTP/2 pseudoheaders (:status, :path, :authority, :scheme,\nand :method) may be used.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_PSEUDOHEADER" }, { "textRaw": "ERR_HTTP2_INVALID_SESSION", "name": "err_http2_invalid_session", "desc": "

An action was performed on an Http2Session object that had already been\ndestroyed.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_SESSION" }, { "textRaw": "ERR_HTTP2_INVALID_SETTING_VALUE", "name": "err_http2_invalid_setting_value", "desc": "

An invalid value has been specified for an HTTP/2 setting.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_SETTING_VALUE" }, { "textRaw": "ERR_HTTP2_INVALID_STREAM", "name": "err_http2_invalid_stream", "desc": "

An operation was performed on a stream that had already been destroyed.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_INVALID_STREAM" }, { "textRaw": "ERR_HTTP2_MAX_PENDING_SETTINGS_ACK", "name": "err_http2_max_pending_settings_ack", "desc": "

Whenever an HTTP/2 SETTINGS frame is sent to a connected peer, the peer is\nrequired to send an acknowledgment that it has received and applied the new\nSETTINGS. By default, a maximum number of unacknowledged SETTINGS frames may\nbe sent at any given time. This error code is used when that limit has been\nreached.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_MAX_PENDING_SETTINGS_ACK" }, { "textRaw": "ERR_HTTP2_NO_SOCKET_MANIPULATION", "name": "err_http2_no_socket_manipulation", "desc": "

An attempt was made to directly manipulate (read, write, pause, resume, etc.) a\nsocket attached to an Http2Session.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_NO_SOCKET_MANIPULATION" }, { "textRaw": "ERR_HTTP2_OUT_OF_STREAMS", "name": "err_http2_out_of_streams", "desc": "

The number of streams created on a single HTTP/2 session reached the maximum\nlimit.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_OUT_OF_STREAMS" }, { "textRaw": "ERR_HTTP2_PAYLOAD_FORBIDDEN", "name": "err_http2_payload_forbidden", "desc": "

A message payload was specified for an HTTP response code for which a payload is\nforbidden.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_PAYLOAD_FORBIDDEN" }, { "textRaw": "ERR_HTTP2_PING_CANCEL", "name": "err_http2_ping_cancel", "desc": "

An HTTP/2 ping was canceled.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_PING_CANCEL" }, { "textRaw": "ERR_HTTP2_PING_LENGTH", "name": "err_http2_ping_length", "desc": "

HTTP/2 ping payloads must be exactly 8 bytes in length.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_PING_LENGTH" }, { "textRaw": "ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED", "name": "err_http2_pseudoheader_not_allowed", "desc": "

An HTTP/2 pseudo-header has been used inappropriately. Pseudo-headers are header\nkey names that begin with the : prefix.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED" }, { "textRaw": "ERR_HTTP2_PUSH_DISABLED", "name": "err_http2_push_disabled", "desc": "

An attempt was made to create a push stream, which had been disabled by the\nclient.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_PUSH_DISABLED" }, { "textRaw": "ERR_HTTP2_SEND_FILE", "name": "err_http2_send_file", "desc": "

An attempt was made to use the Http2Stream.prototype.responseWithFile() API to\nsend something other than a regular file.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_SEND_FILE" }, { "textRaw": "ERR_HTTP2_SESSION_ERROR", "name": "err_http2_session_error", "desc": "

The Http2Session closed with a non-zero error code.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_SESSION_ERROR" }, { "textRaw": "ERR_HTTP2_SOCKET_BOUND", "name": "err_http2_socket_bound", "desc": "

An attempt was made to connect a Http2Session object to a net.Socket or\ntls.TLSSocket that had already been bound to another Http2Session object.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_SOCKET_BOUND" }, { "textRaw": "ERR_HTTP2_STATUS_101", "name": "err_http2_status_101", "desc": "

Use of the 101 Informational status code is forbidden in HTTP/2.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_STATUS_101" }, { "textRaw": "ERR_HTTP2_STATUS_INVALID", "name": "err_http2_status_invalid", "desc": "

An invalid HTTP status code has been specified. Status codes must be an integer\nbetween 100 and 599 (inclusive).

\n

\n", "type": "module", "displayName": "ERR_HTTP2_STATUS_INVALID" }, { "textRaw": "ERR_HTTP2_STREAM_CANCEL", "name": "err_http2_stream_cancel", "desc": "

An Http2Stream was destroyed before any data was transmitted to the connected\npeer.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_STREAM_CANCEL" }, { "textRaw": "ERR_HTTP2_STREAM_ERROR", "name": "err_http2_stream_error", "desc": "

A non-zero error code was been specified in an RST_STREAM frame.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_STREAM_ERROR" }, { "textRaw": "ERR_HTTP2_STREAM_SELF_DEPENDENCY", "name": "err_http2_stream_self_dependency", "desc": "

When setting the priority for an HTTP/2 stream, the stream may be marked as\na dependency for a parent stream. This error code is used when an attempt is\nmade to mark a stream and dependent of itself.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_STREAM_SELF_DEPENDENCY" }, { "textRaw": "ERR_HTTP2_UNSUPPORTED_PROTOCOL", "name": "err_http2_unsupported_protocol", "desc": "

http2.connect() was passed a URL that uses any protocol other than http: or\nhttps:.

\n

\n", "type": "module", "displayName": "ERR_HTTP2_UNSUPPORTED_PROTOCOL" }, { "textRaw": "ERR_INDEX_OUT_OF_RANGE", "name": "err_index_out_of_range", "desc": "

A given index was out of the accepted range (e.g. negative offsets).

\n

\n", "type": "module", "displayName": "ERR_INDEX_OUT_OF_RANGE" }, { "textRaw": "ERR_INSPECTOR_ALREADY_CONNECTED", "name": "err_inspector_already_connected", "desc": "

While using the inspector module, an attempt was made to connect when the\ninspector was already connected.

\n

\n", "type": "module", "displayName": "ERR_INSPECTOR_ALREADY_CONNECTED" }, { "textRaw": "ERR_INSPECTOR_CLOSED", "name": "err_inspector_closed", "desc": "

While using the inspector module, an attempt was made to use the inspector\nafter the session had already closed.

\n

\n", "type": "module", "displayName": "ERR_INSPECTOR_CLOSED" }, { "textRaw": "ERR_INSPECTOR_NOT_AVAILABLE", "name": "err_inspector_not_available", "desc": "

The inspector module is not available for use.

\n

\n", "type": "module", "displayName": "ERR_INSPECTOR_NOT_AVAILABLE" }, { "textRaw": "ERR_INSPECTOR_NOT_CONNECTED", "name": "err_inspector_not_connected", "desc": "

While using the inspector module, an attempt was made to use the inspector\nbefore it was connected.

\n

\n", "type": "module", "displayName": "ERR_INSPECTOR_NOT_CONNECTED" }, { "textRaw": "ERR_INVALID_ARG_TYPE", "name": "err_invalid_arg_type", "desc": "

An argument of the wrong type was passed to a Node.js API.

\n

\n", "type": "module", "displayName": "ERR_INVALID_ARG_TYPE" }, { "textRaw": "ERR_INVALID_ARG_VALUE", "name": "err_invalid_arg_value", "desc": "

An invalid or unsupported value was passed for a given argument.

\n

\n", "type": "module", "displayName": "ERR_INVALID_ARG_VALUE" }, { "textRaw": "ERR_INVALID_ARRAY_LENGTH", "name": "err_invalid_array_length", "desc": "

An Array was not of the expected length or in a valid range.

\n

\n", "type": "module", "displayName": "ERR_INVALID_ARRAY_LENGTH" }, { "textRaw": "ERR_INVALID_ASYNC_ID", "name": "err_invalid_async_id", "desc": "

An invalid asyncId or triggerAsyncId was passed using AsyncHooks. An id\nless than -1 should never happen.

\n

\n", "type": "module", "displayName": "ERR_INVALID_ASYNC_ID" }, { "textRaw": "ERR_INVALID_BUFFER_SIZE", "name": "err_invalid_buffer_size", "desc": "

A swap was performed on a Buffer but its size was not compatible with the\noperation.

\n

\n", "type": "module", "displayName": "ERR_INVALID_BUFFER_SIZE" }, { "textRaw": "ERR_INVALID_CALLBACK", "name": "err_invalid_callback", "desc": "

A callback function was required but was not been provided to a Node.js API.

\n

\n", "type": "module", "displayName": "ERR_INVALID_CALLBACK" }, { "textRaw": "ERR_INVALID_CHAR", "name": "err_invalid_char", "desc": "

Invalid characters were detected in headers.

\n

\n", "type": "module", "displayName": "ERR_INVALID_CHAR" }, { "textRaw": "ERR_INVALID_CURSOR_POS", "name": "err_invalid_cursor_pos", "desc": "

A cursor on a given stream cannot be moved to a specified row without a\nspecified column.

\n

\n", "type": "module", "displayName": "ERR_INVALID_CURSOR_POS" }, { "textRaw": "ERR_INVALID_DOMAIN_NAME", "name": "err_invalid_domain_name", "desc": "

hostname can not be parsed from a provided URL.

\n

\n", "type": "module", "displayName": "ERR_INVALID_DOMAIN_NAME" }, { "textRaw": "ERR_INVALID_FD", "name": "err_invalid_fd", "desc": "

A file descriptor ('fd') was not valid (e.g. it was a negative value).

\n

\n", "type": "module", "displayName": "ERR_INVALID_FD" }, { "textRaw": "ERR_INVALID_FD_TYPE", "name": "err_invalid_fd_type", "desc": "

A file descriptor ('fd') type was not valid.

\n

\n", "type": "module", "displayName": "ERR_INVALID_FD_TYPE" }, { "textRaw": "ERR_INVALID_FILE_URL_HOST", "name": "err_invalid_file_url_host", "desc": "

A Node.js API that consumes file: URLs (such as certain functions in the\nfs module) encountered a file URL with an incompatible host. This\nsituation can only occur on Unix-like systems where only localhost or an empty\nhost is supported.

\n

\n", "type": "module", "displayName": "ERR_INVALID_FILE_URL_HOST" }, { "textRaw": "ERR_INVALID_FILE_URL_PATH", "name": "err_invalid_file_url_path", "desc": "

A Node.js API that consumes file: URLs (such as certain functions in the\nfs module) encountered a file URL with an incompatible path. The exact\nsemantics for determining whether a path can be used is platform-dependent.

\n

\n", "type": "module", "displayName": "ERR_INVALID_FILE_URL_PATH" }, { "textRaw": "ERR_INVALID_HANDLE_TYPE", "name": "err_invalid_handle_type", "desc": "

An attempt was made to send an unsupported "handle" over an IPC communication\nchannel to a child process. See subprocess.send() and process.send() for\nmore information.

\n

\n", "type": "module", "displayName": "ERR_INVALID_HANDLE_TYPE" }, { "textRaw": "ERR_INVALID_HTTP_TOKEN", "name": "err_invalid_http_token", "desc": "

An invalid HTTP token was supplied.

\n

\n", "type": "module", "displayName": "ERR_INVALID_HTTP_TOKEN" }, { "textRaw": "ERR_INVALID_IP_ADDRESS", "name": "err_invalid_ip_address", "desc": "

An IP address is not valid.

\n

\n", "type": "module", "displayName": "ERR_INVALID_IP_ADDRESS" }, { "textRaw": "ERR_INVALID_OPT_VALUE", "name": "err_invalid_opt_value", "desc": "

An invalid or unexpected value was passed in an options object.

\n

\n", "type": "module", "displayName": "ERR_INVALID_OPT_VALUE" }, { "textRaw": "ERR_INVALID_OPT_VALUE_ENCODING", "name": "err_invalid_opt_value_encoding", "desc": "

An invalid or unknown file encoding was passed.

\n

\n", "type": "module", "displayName": "ERR_INVALID_OPT_VALUE_ENCODING" }, { "textRaw": "ERR_INVALID_PERFORMANCE_MARK", "name": "err_invalid_performance_mark", "desc": "

While using the Performance Timing API (perf_hooks), a performance mark is\ninvalid.

\n

\n", "type": "module", "displayName": "ERR_INVALID_PERFORMANCE_MARK" }, { "textRaw": "ERR_INVALID_PROTOCOL", "name": "err_invalid_protocol", "desc": "

An invalid options.protocol was passed.

\n

\n", "type": "module", "displayName": "ERR_INVALID_PROTOCOL" }, { "textRaw": "ERR_INVALID_REPL_EVAL_CONFIG", "name": "err_invalid_repl_eval_config", "desc": "

Both breakEvalOnSigint and eval options were set in the REPL config, which\nis not supported.

\n

\n", "type": "module", "displayName": "ERR_INVALID_REPL_EVAL_CONFIG" }, { "textRaw": "ERR_INVALID_SYNC_FORK_INPUT", "name": "err_invalid_sync_fork_input", "desc": "

A Buffer, Uint8Array or string was provided as stdio input to a\nsynchronous fork. See the documentation for the child_process module\nfor more information.

\n

\n", "type": "module", "displayName": "ERR_INVALID_SYNC_FORK_INPUT" }, { "textRaw": "ERR_INVALID_THIS", "name": "err_invalid_this", "desc": "

A Node.js API function was called with an incompatible this value.

\n

Example:

\n
const { URLSearchParams } = require('url');\nconst urlSearchParams = new URLSearchParams('foo=bar&baz=new');\n\nconst buf = Buffer.alloc(1);\nurlSearchParams.has.call(buf, 'foo');\n// Throws a TypeError with code 'ERR_INVALID_THIS'\n
\n

\n", "type": "module", "displayName": "ERR_INVALID_THIS" }, { "textRaw": "ERR_INVALID_TUPLE", "name": "err_invalid_tuple", "desc": "

An element in the iterable provided to the WHATWG\nURLSearchParams constructor did not\nrepresent a [name, value] tuple – that is, if an element is not iterable, or\ndoes not consist of exactly two elements.

\n

\n", "type": "module", "displayName": "ERR_INVALID_TUPLE" }, { "textRaw": "ERR_INVALID_URI", "name": "err_invalid_uri", "desc": "

An invalid URI was passed.

\n

\n", "type": "module", "displayName": "ERR_INVALID_URI" }, { "textRaw": "ERR_INVALID_URL", "name": "err_invalid_url", "desc": "

An invalid URL was passed to the WHATWG\nURL constructor to be parsed. The thrown error object\ntypically has an additional property 'input' that contains the URL that failed\nto parse.

\n

\n", "type": "module", "displayName": "ERR_INVALID_URL" }, { "textRaw": "ERR_INVALID_URL_SCHEME", "name": "err_invalid_url_scheme", "desc": "

An attempt was made to use a URL of an incompatible scheme (protocol) for a\nspecific purpose. It is only used in the WHATWG URL API support in the\nfs module (which only accepts URLs with 'file' scheme), but may be used\nin other Node.js APIs as well in the future.

\n

\n", "type": "module", "displayName": "ERR_INVALID_URL_SCHEME" }, { "textRaw": "ERR_IPC_CHANNEL_CLOSED", "name": "err_ipc_channel_closed", "desc": "

An attempt was made to use an IPC communication channel that was already closed.

\n

\n", "type": "module", "displayName": "ERR_IPC_CHANNEL_CLOSED" }, { "textRaw": "ERR_IPC_DISCONNECTED", "name": "err_ipc_disconnected", "desc": "

An attempt was made to disconnect an IPC communication channel that was already\ndisconnected. See the documentation for the child_process module\nfor more information.

\n

\n", "type": "module", "displayName": "ERR_IPC_DISCONNECTED" }, { "textRaw": "ERR_IPC_ONE_PIPE", "name": "err_ipc_one_pipe", "desc": "

An attempt was made to create a child Node.js process using more than one IPC\ncommunication channel. See the documentation for the child_process module\nfor more information.

\n

\n", "type": "module", "displayName": "ERR_IPC_ONE_PIPE" }, { "textRaw": "ERR_IPC_SYNC_FORK", "name": "err_ipc_sync_fork", "desc": "

An attempt was made to open an IPC communication channel with a synchronously\nforked Node.js process. See the documentation for the child_process module\nfor more information.

\n

\n", "type": "module", "displayName": "ERR_IPC_SYNC_FORK" }, { "textRaw": "ERR_METHOD_NOT_IMPLEMENTED", "name": "err_method_not_implemented", "desc": "

A method is required but not implemented.

\n

\n", "type": "module", "displayName": "ERR_METHOD_NOT_IMPLEMENTED" }, { "textRaw": "ERR_MISSING_ARGS", "name": "err_missing_args", "desc": "

A required argument of a Node.js API was not passed. This is only used for\nstrict compliance with the API specification (which in some cases may accept\nfunc(undefined) but not func()). In most native Node.js APIs,\nfunc(undefined) and func() are treated identically, and the\nERR_INVALID_ARG_TYPE error code may be used instead.

\n

\n", "type": "module", "displayName": "ERR_MISSING_ARGS" }, { "textRaw": "ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK", "name": "err_missing_dynamic_instantiate_hook", "stability": 1, "stabilityText": "Experimental", "desc": "

An ES6 module loader hook specified format: 'dynamic but did not provide a\ndynamicInstantiate hook.

\n

\n", "type": "module", "displayName": "ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK" }, { "textRaw": "ERR_MISSING_MODULE", "name": "err_missing_module", "stability": 1, "stabilityText": "Experimental", "desc": "

An ES6 module could not be resolved.

\n

\n", "type": "module", "displayName": "ERR_MISSING_MODULE" }, { "textRaw": "ERR_MODULE_RESOLUTION_LEGACY", "name": "err_module_resolution_legacy", "stability": 1, "stabilityText": "Experimental", "desc": "

A failure occurred resolving imports in an ES6 module.

\n

\n", "type": "module", "displayName": "ERR_MODULE_RESOLUTION_LEGACY" }, { "textRaw": "ERR_MULTIPLE_CALLBACK", "name": "err_multiple_callback", "desc": "

A callback was called more than once.

\n

Note: A callback is almost always meant to only be called once as the query\ncan either be fulfilled or rejected but not both at the same time. The latter\nwould be possible by calling a callback more than once.

\n

\n", "type": "module", "displayName": "ERR_MULTIPLE_CALLBACK" }, { "textRaw": "ERR_NAPI_CONS_FUNCTION", "name": "err_napi_cons_function", "desc": "

While using N-API, a constructor passed was not a function.

\n

\n", "type": "module", "displayName": "ERR_NAPI_CONS_FUNCTION" }, { "textRaw": "ERR_NAPI_CONS_PROTOTYPE_OBJECT", "name": "err_napi_cons_prototype_object", "desc": "

While using N-API, Constructor.prototype was not an object.

\n

\n", "type": "module", "displayName": "ERR_NAPI_CONS_PROTOTYPE_OBJECT" }, { "textRaw": "ERR_NAPI_INVALID_DATAVIEW_ARGS", "name": "err_napi_invalid_dataview_args", "desc": "

While calling napi_create_dataview(), a given offset was outside the bounds\nof the dataview or offset + length was larger than a length of given buffer.

\n

\n", "type": "module", "displayName": "ERR_NAPI_INVALID_DATAVIEW_ARGS" }, { "textRaw": "ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT", "name": "err_napi_invalid_typedarray_alignment", "desc": "

While calling napi_create_typedarray(), the provided offset was not a\nmultiple of the element size.

\n

\n", "type": "module", "displayName": "ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT" }, { "textRaw": "ERR_NAPI_INVALID_TYPEDARRAY_LENGTH", "name": "err_napi_invalid_typedarray_length", "desc": "

While calling napi_create_typedarray(), (length * size_of_element) +\nbyte_offset was larger than the length of given buffer.

\n

\n", "type": "module", "displayName": "ERR_NAPI_INVALID_TYPEDARRAY_LENGTH" }, { "textRaw": "ERR_NO_CRYPTO", "name": "err_no_crypto", "desc": "

An attempt was made to use crypto features while Node.js was not compiled with\nOpenSSL crypto support.

\n

\n", "type": "module", "displayName": "ERR_NO_CRYPTO" }, { "textRaw": "ERR_NO_ICU", "name": "err_no_icu", "desc": "

An attempt was made to use features that require ICU, but Node.js was not\ncompiled with ICU support.

\n

\n", "type": "module", "displayName": "ERR_NO_ICU" }, { "textRaw": "ERR_NO_LONGER_SUPPORTED", "name": "err_no_longer_supported", "desc": "

A Node.js API was called in an unsupported manner, such as\nBuffer.write(string, encoding, offset[, length]).

\n

\n", "type": "module", "displayName": "ERR_NO_LONGER_SUPPORTED" }, { "textRaw": "ERR_OUT_OF_RANGE", "name": "err_out_of_range", "desc": "

An input argument value was outside an acceptable range.

\n

\n", "type": "module", "displayName": "ERR_OUT_OF_RANGE" }, { "textRaw": "ERR_PARSE_HISTORY_DATA", "name": "err_parse_history_data", "desc": "

The REPL module was unable parse data from the REPL history file.

\n

\n", "type": "module", "displayName": "ERR_PARSE_HISTORY_DATA" }, { "textRaw": "ERR_REQUIRE_ESM", "name": "err_require_esm", "stability": 1, "stabilityText": "Experimental", "desc": "

An attempt was made to require() an ES6 module.

\n

\n", "type": "module", "displayName": "ERR_REQUIRE_ESM" }, { "textRaw": "ERR_SERVER_ALREADY_LISTEN", "name": "err_server_already_listen", "desc": "

The server.listen() method was called while a net.Server was already\nlistening. This applies to all instances of net.Server, including HTTP, HTTPS,\nand HTTP/2 Server instances.

\n

\n", "type": "module", "displayName": "ERR_SERVER_ALREADY_LISTEN" }, { "textRaw": "ERR_SOCKET_ALREADY_BOUND", "name": "err_socket_already_bound", "desc": "

An attempt was made to bind a socket that has already been bound.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_ALREADY_BOUND" }, { "textRaw": "ERR_SOCKET_BAD_BUFFER_SIZE", "name": "err_socket_bad_buffer_size", "desc": "

An invalid (negative) size was passed for either the recvBufferSize or\nsendBufferSize options in dgram.createSocket().

\n

\n", "type": "module", "displayName": "ERR_SOCKET_BAD_BUFFER_SIZE" }, { "textRaw": "ERR_SOCKET_BAD_PORT", "name": "err_socket_bad_port", "desc": "

An API function expecting a port > 0 and < 65536 received an invalid value.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_BAD_PORT" }, { "textRaw": "ERR_SOCKET_BAD_TYPE", "name": "err_socket_bad_type", "desc": "

An API function expecting a socket type (udp4 or udp6) received an invalid\nvalue.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_BAD_TYPE" }, { "textRaw": "ERR_SOCKET_BUFFER_SIZE", "name": "err_socket_buffer_size", "desc": "

While using dgram.createSocket(), the size of the receive or send Buffer\ncould not be determined.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_BUFFER_SIZE" }, { "textRaw": "ERR_SOCKET_CANNOT_SEND", "name": "err_socket_cannot_send", "desc": "

Data could be sent on a socket.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_CANNOT_SEND" }, { "textRaw": "ERR_SOCKET_CLOSED", "name": "err_socket_closed", "desc": "

An attempt was made to operate on an already closed socket.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_CLOSED" }, { "textRaw": "ERR_SOCKET_DGRAM_NOT_RUNNING", "name": "err_socket_dgram_not_running", "desc": "

A call was made and the UDP subsystem was not running.

\n

\n", "type": "module", "displayName": "ERR_SOCKET_DGRAM_NOT_RUNNING" }, { "textRaw": "ERR_STDERR_CLOSE", "name": "err_stderr_close", "desc": "

An attempt was made to close the process.stderr stream. By design, Node.js\ndoes not allow stdout or stderr streams to be closed by user code.

\n

\n", "type": "module", "displayName": "ERR_STDERR_CLOSE" }, { "textRaw": "ERR_STDOUT_CLOSE", "name": "err_stdout_close", "desc": "

An attempt was made to close the process.stdout stream. By design, Node.js\ndoes not allow stdout or stderr streams to be closed by user code.

\n

\n", "type": "module", "displayName": "ERR_STDOUT_CLOSE" }, { "textRaw": "ERR_STREAM_CANNOT_PIPE", "name": "err_stream_cannot_pipe", "desc": "

An attempt was made to call stream.pipe() on a Writable stream.

\n

\n", "type": "module", "displayName": "ERR_STREAM_CANNOT_PIPE" }, { "textRaw": "ERR_STREAM_NULL_VALUES", "name": "err_stream_null_values", "desc": "

An attempt was made to call stream.write() with a null chunk.

\n

\n", "type": "module", "displayName": "ERR_STREAM_NULL_VALUES" }, { "textRaw": "ERR_STREAM_PUSH_AFTER_EOF", "name": "err_stream_push_after_eof", "desc": "

An attempt was made to call stream.push() after a null(EOF) had been\npushed to the stream.

\n

\n", "type": "module", "displayName": "ERR_STREAM_PUSH_AFTER_EOF" }, { "textRaw": "ERR_STREAM_READ_NOT_IMPLEMENTED", "name": "err_stream_read_not_implemented", "desc": "

An attempt was made to use a readable stream that did not implement\nreadable._read().

\n

\n", "type": "module", "displayName": "ERR_STREAM_READ_NOT_IMPLEMENTED" }, { "textRaw": "ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "name": "err_stream_unshift_after_end_event", "desc": "

An attempt was made to call stream.unshift() after the end event was\nemitted.

\n

\n", "type": "module", "displayName": "ERR_STREAM_UNSHIFT_AFTER_END_EVENT" }, { "textRaw": "ERR_STREAM_WRAP", "name": "err_stream_wrap", "desc": "

Prevents an abort if a string decoder was set on the Socket or if the decoder\nis in objectMode.

\n

Example

\n
const Socket = require('net').Socket;\nconst instance = new Socket();\n\ninstance.setEncoding('utf8');\n
\n

\n", "type": "module", "displayName": "ERR_STREAM_WRAP" }, { "textRaw": "ERR_STREAM_WRITE_AFTER_END", "name": "err_stream_write_after_end", "desc": "

An attempt was made to call stream.write() after stream.end() has been\ncalled.

\n

\n", "type": "module", "displayName": "ERR_STREAM_WRITE_AFTER_END" }, { "textRaw": "ERR_TLS_CERT_ALTNAME_INVALID", "name": "err_tls_cert_altname_invalid", "desc": "

While using TLS, the hostname/IP of the peer did not match any of the\nsubjectAltNames in its certificate.

\n

\n", "type": "module", "displayName": "ERR_TLS_CERT_ALTNAME_INVALID" }, { "textRaw": "ERR_TLS_DH_PARAM_SIZE", "name": "err_tls_dh_param_size", "desc": "

While using TLS, the parameter offered for the Diffie-Hellman (DH)\nkey-agreement protocol is too small. By default, the key length must be greater\nthan or equal to 1024 bits to avoid vulnerabilities, even though it is strongly\nrecommended to use 2048 bits or larger for stronger security.

\n

\n", "type": "module", "displayName": "ERR_TLS_DH_PARAM_SIZE" }, { "textRaw": "ERR_TLS_HANDSHAKE_TIMEOUT", "name": "err_tls_handshake_timeout", "desc": "

A TLS/SSL handshake timed out. In this case, the server must also abort the\nconnection.

\n

\n", "type": "module", "displayName": "ERR_TLS_HANDSHAKE_TIMEOUT" }, { "textRaw": "ERR_TLS_RENEGOTIATION_FAILED", "name": "err_tls_renegotiation_failed", "desc": "

A TLS renegotiation request has failed in a non-specific way.

\n

\n", "type": "module", "displayName": "ERR_TLS_RENEGOTIATION_FAILED" }, { "textRaw": "ERR_TLS_REQUIRED_SERVER_NAME", "name": "err_tls_required_server_name", "desc": "

While using TLS, the server.addContext() method was called without providing\na hostname in the first parameter.

\n

\n", "type": "module", "displayName": "ERR_TLS_REQUIRED_SERVER_NAME" }, { "textRaw": "ERR_TLS_SESSION_ATTACK", "name": "err_tls_session_attack", "desc": "

An excessive amount of TLS renegotiations is detected, which is a potential\nvector for denial-of-service attacks.

\n

\n", "type": "module", "displayName": "ERR_TLS_SESSION_ATTACK" }, { "textRaw": "ERR_TRANSFORM_ALREADY_TRANSFORMING", "name": "err_transform_already_transforming", "desc": "

A Transform stream finished while it was still transforming.

\n

\n", "type": "module", "displayName": "ERR_TRANSFORM_ALREADY_TRANSFORMING" }, { "textRaw": "ERR_TRANSFORM_WITH_LENGTH_0", "name": "err_transform_with_length_0", "desc": "

A Transform stream finished with data still in the write buffer.

\n

\n", "type": "module", "displayName": "ERR_TRANSFORM_WITH_LENGTH_0" }, { "textRaw": "ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET", "name": "err_uncaught_exception_capture_already_set", "desc": "

process.setUncaughtExceptionCaptureCallback() was called twice,\nwithout first resetting the callback to null.

\n

This error is designed to prevent accidentally overwriting a callback registered\nfrom another module.

\n

\n", "type": "module", "displayName": "ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET" }, { "textRaw": "ERR_UNESCAPED_CHARACTERS", "name": "err_unescaped_characters", "desc": "

A string that contained unescaped characters was received.

\n

\n", "type": "module", "displayName": "ERR_UNESCAPED_CHARACTERS" }, { "textRaw": "ERR_UNHANDLED_ERROR", "name": "err_unhandled_error", "desc": "

An unhandled error occurred (for instance, when an 'error' event is emitted\nby an EventEmitter but an 'error' handler is not registered).

\n

\n", "type": "module", "displayName": "ERR_UNHANDLED_ERROR" }, { "textRaw": "ERR_UNKNOWN_ENCODING", "name": "err_unknown_encoding", "desc": "

An invalid or unknown encoding option was passed to an API.

\n

\n", "type": "module", "displayName": "ERR_UNKNOWN_ENCODING" }, { "textRaw": "ERR_UNKNOWN_FILE_EXTENSION", "name": "err_unknown_file_extension", "stability": 1, "stabilityText": "Experimental", "desc": "

An attempt was made to load a module with an unknown or unsupported file\nextension.

\n

\n", "type": "module", "displayName": "ERR_UNKNOWN_FILE_EXTENSION" }, { "textRaw": "ERR_UNKNOWN_MODULE_FORMAT", "name": "err_unknown_module_format", "stability": 1, "stabilityText": "Experimental", "desc": "

An attempt was made to load a module with an unknown or unsupported format.

\n

\n", "type": "module", "displayName": "ERR_UNKNOWN_MODULE_FORMAT" }, { "textRaw": "ERR_UNKNOWN_SIGNAL", "name": "err_unknown_signal", "desc": "

An invalid or unknown process signal was passed to an API expecting a valid\nsignal (such as subprocess.kill()).

\n

\n", "type": "module", "displayName": "ERR_UNKNOWN_SIGNAL" }, { "textRaw": "ERR_UNKNOWN_STDIN_TYPE", "name": "err_unknown_stdin_type", "desc": "

An attempt was made to launch a Node.js process with an unknown stdin file\ntype. This error is usually an indication of a bug within Node.js itself,\nalthough it is possible for user code to trigger it.

\n

\n", "type": "module", "displayName": "ERR_UNKNOWN_STDIN_TYPE" }, { "textRaw": "ERR_UNKNOWN_STREAM_TYPE", "name": "err_unknown_stream_type", "desc": "

An attempt was made to launch a Node.js process with an unknown stdout or\nstderr file type. This error is usually an indication of a bug within Node.js\nitself, although it is possible for user code to trigger it.

\n

\n", "type": "module", "displayName": "ERR_UNKNOWN_STREAM_TYPE" }, { "textRaw": "ERR_V8BREAKITERATOR", "name": "err_v8breakiterator", "desc": "

The V8 BreakIterator API was used but the full ICU data set is not installed.

\n

\n", "type": "module", "displayName": "ERR_V8BREAKITERATOR" }, { "textRaw": "ERR_VALID_PERFORMANCE_ENTRY_TYPE", "name": "err_valid_performance_entry_type", "desc": "

While using the Performance Timing API (perf_hooks), no valid performance\nentry types were found.

\n

\n", "type": "module", "displayName": "ERR_VALID_PERFORMANCE_ENTRY_TYPE" }, { "textRaw": "ERR_VALUE_OUT_OF_RANGE", "name": "err_value_out_of_range", "desc": "

A given value is out of the accepted range.

\n

\n", "type": "module", "displayName": "ERR_VALUE_OUT_OF_RANGE" }, { "textRaw": "ERR_VM_MODULE_ALREADY_LINKED", "name": "err_vm_module_already_linked", "desc": "

The module attempted to be linked is not eligible for linking, because of one of\nthe following reasons:

\n\n

\n", "type": "module", "displayName": "ERR_VM_MODULE_ALREADY_LINKED" }, { "textRaw": "ERR_VM_MODULE_DIFFERENT_CONTEXT", "name": "err_vm_module_different_context", "desc": "

The module being returned from the linker function is from a different context\nthan the parent module. Linked modules must share the same context.

\n

\n", "type": "module", "displayName": "ERR_VM_MODULE_DIFFERENT_CONTEXT" }, { "textRaw": "ERR_VM_MODULE_LINKING_ERRORED", "name": "err_vm_module_linking_errored", "desc": "

The linker function returned a module for which linking has failed.

\n

\n", "type": "module", "displayName": "ERR_VM_MODULE_LINKING_ERRORED" }, { "textRaw": "ERR_VM_MODULE_NOT_LINKED", "name": "err_vm_module_not_linked", "desc": "

The module must be successfully linked before instantiation.

\n

\n", "type": "module", "displayName": "ERR_VM_MODULE_NOT_LINKED" }, { "textRaw": "ERR_VM_MODULE_NOT_MODULE", "name": "err_vm_module_not_module", "desc": "

The fulfilled value of a linking promise is not a vm.Module object.

\n

\n", "type": "module", "displayName": "ERR_VM_MODULE_NOT_MODULE" }, { "textRaw": "ERR_VM_MODULE_STATUS", "name": "err_vm_module_status", "desc": "

The current module's status does not allow for this operation. The specific\nmeaning of the error depends on the specific function.

\n

\n", "type": "module", "displayName": "ERR_VM_MODULE_STATUS" }, { "textRaw": "ERR_ZLIB_BINDING_CLOSED", "name": "err_zlib_binding_closed", "desc": "

An attempt was made to use a zlib object after it has already been closed.

\n

\n", "type": "module", "displayName": "ERR_ZLIB_BINDING_CLOSED" }, { "textRaw": "ERR_ZLIB_INITIALIZATION_FAILED", "name": "err_zlib_initialization_failed", "desc": "

Creation of a zlib object failed due to incorrect configuration.

\n", "type": "module", "displayName": "ERR_ZLIB_INITIALIZATION_FAILED" } ], "type": "misc", "displayName": "Node.js Error Codes" } ], "classes": [ { "textRaw": "Class: Error", "type": "class", "name": "Error", "desc": "

A generic JavaScript Error object that does not denote any specific\ncircumstance of why the error occurred. Error objects capture a "stack trace"\ndetailing the point in the code at which the Error was instantiated, and may\nprovide a text description of the error.

\n

For crypto only, Error objects will include the OpenSSL error stack in a\nseparate property called opensslErrorStack if it is available when the error\nis thrown.

\n

All errors generated by Node.js, including all System and JavaScript errors,\nwill either be instances of, or inherit from, the Error class.

\n", "methods": [ { "textRaw": "Error.captureStackTrace(targetObject[, constructorOpt])", "type": "method", "name": "captureStackTrace", "signatures": [ { "params": [ { "textRaw": "`targetObject` {Object} ", "name": "targetObject", "type": "Object" }, { "textRaw": "`constructorOpt` {Function} ", "name": "constructorOpt", "type": "Function", "optional": true } ] }, { "params": [ { "name": "targetObject" }, { "name": "constructorOpt", "optional": true } ] } ], "desc": "

Creates a .stack property on targetObject, which when accessed returns\na string representing the location in the code at which\nError.captureStackTrace() was called.

\n
const myObject = {};\nError.captureStackTrace(myObject);\nmyObject.stack;  // similar to `new Error().stack`\n
\n

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

\n

The optional constructorOpt argument accepts a function. If given, all frames\nabove constructorOpt, including constructorOpt, will be omitted from the\ngenerated stack trace.

\n

The constructorOpt argument is useful for hiding implementation\ndetails of error generation from an end user. For instance:

\n
function MyError() {\n  Error.captureStackTrace(this, MyError);\n}\n\n// Without passing MyError to captureStackTrace, the MyError\n// frame would show up in the .stack property. By passing\n// the constructor, we omit that frame, and retain all frames below it.\nnew MyError().stack;\n
\n" } ], "properties": [ { "textRaw": "`stackTraceLimit` {number} ", "type": "number", "name": "stackTraceLimit", "desc": "

The Error.stackTraceLimit property specifies the number of stack frames\ncollected by a stack trace (whether generated by new Error().stack or\nError.captureStackTrace(obj)).

\n

The default value is 10 but may be set to any valid JavaScript number. Changes\nwill affect any stack trace captured after the value has been changed.

\n

If set to a non-number value, or set to a negative number, stack traces will\nnot capture any frames.

\n" }, { "textRaw": "`code` {string} ", "type": "string", "name": "code", "desc": "

The error.code property is a string label that identifies the kind of error.\nSee Node.js Error Codes for details about specific codes.

\n" }, { "textRaw": "`message` {string} ", "type": "string", "name": "message", "desc": "

The error.message property is the string description of the error as set by\ncalling new Error(message). The message passed to the constructor will also\nappear in the first line of the stack trace of the Error, however changing\nthis property after the Error object is created may not change the first\nline of the stack trace (for example, when error.stack is read before this\nproperty is changed).

\n
const err = new Error('The message');\nconsole.error(err.message);\n// Prints: The message\n
\n" }, { "textRaw": "`stack` {string} ", "type": "string", "name": "stack", "desc": "

The error.stack property is a string describing the point in the code at which\nthe Error was instantiated.

\n
Error: Things keep happening!\n   at /home/gbusey/file.js:525:2\n   at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)\n   at Actor.<anonymous> (/home/gbusey/actors.js:400:8)\n   at increaseSynergy (/home/gbusey/actors.js:701:6)\n
\n

The first line is formatted as <error class name>: <error message>, and\nis followed by a series of stack frames (each line beginning with "at ").\nEach frame describes a call site within the code that lead to the error being\ngenerated. V8 attempts to display a name for each function (by variable name,\nfunction name, or object method name), but occasionally it will not be able to\nfind a suitable name. If V8 cannot determine a name for the function, only\nlocation information will be displayed for that frame. Otherwise, the\ndetermined function name will be displayed with location information appended\nin parentheses.

\n

Frames are only generated for JavaScript functions. If, for example, execution\nsynchronously passes through a C++ addon function called cheetahify which\nitself calls a JavaScript function, the frame representing the cheetahify call\nwill not be present in the stack traces:

\n
const cheetahify = require('./native-binding.node');\n\nfunction makeFaster() {\n  // cheetahify *synchronously* calls speedy.\n  cheetahify(function speedy() {\n    throw new Error('oh no!');\n  });\n}\n\nmakeFaster();\n// will throw:\n//   /home/gbusey/file.js:6\n//       throw new Error('oh no!');\n//           ^\n//   Error: oh no!\n//       at speedy (/home/gbusey/file.js:6:11)\n//       at makeFaster (/home/gbusey/file.js:5:3)\n//       at Object.<anonymous> (/home/gbusey/file.js:10:1)\n//       at Module._compile (module.js:456:26)\n//       at Object.Module._extensions..js (module.js:474:10)\n//       at Module.load (module.js:356:32)\n//       at Function.Module._load (module.js:312:12)\n//       at Function.Module.runMain (module.js:497:10)\n//       at startup (node.js:119:16)\n//       at node.js:906:3\n
\n

The location information will be one of:

\n\n

The string representing the stack trace is lazily generated when the\nerror.stack property is accessed.

\n

The number of frames captured by the stack trace is bounded by the smaller of\nError.stackTraceLimit or the number of available frames on the current event\nloop tick.

\n

System-level errors are generated as augmented Error instances, which are\ndetailed here.

\n" } ], "signatures": [ { "params": [ { "textRaw": "`message` {string} ", "name": "message", "type": "string" } ], "desc": "

Creates a new Error object and sets the error.message property to the\nprovided text message. If an object is passed as message, the text message\nis generated by calling message.toString(). The error.stack property will\nrepresent the point in the code at which new Error() was called. Stack traces\nare dependent on V8's stack trace API. Stack traces extend only to either\n(a) the beginning of synchronous code execution, or (b) the number of frames\ngiven by the property Error.stackTraceLimit, whichever is smaller.

\n" }, { "params": [ { "name": "message" } ], "desc": "

Creates a new Error object and sets the error.message property to the\nprovided text message. If an object is passed as message, the text message\nis generated by calling message.toString(). The error.stack property will\nrepresent the point in the code at which new Error() was called. Stack traces\nare dependent on V8's stack trace API. Stack traces extend only to either\n(a) the beginning of synchronous code execution, or (b) the number of frames\ngiven by the property Error.stackTraceLimit, whichever is smaller.

\n" } ] }, { "textRaw": "Class: AssertionError", "type": "class", "name": "AssertionError", "desc": "

A subclass of Error that indicates the failure of an assertion. Such errors\ncommonly indicate inequality of actual and expected value.

\n
assert.strictEqual(1, 2);\n// AssertionError [ERR_ASSERTION]: 1 === 2\n
\n" }, { "textRaw": "Class: RangeError", "type": "class", "name": "RangeError", "desc": "

A subclass of Error that indicates that a provided argument was not within the\nset or range of acceptable values for a function; whether that is a numeric\nrange, or outside the set of options for a given function parameter.

\n
require('net').connect(-1);\n// throws "RangeError: "port" option should be >= 0 and < 65536: -1"\n
\n

Node.js will generate and throw RangeError instances immediately as a form\nof argument validation.

\n" }, { "textRaw": "Class: ReferenceError", "type": "class", "name": "ReferenceError", "desc": "

A subclass of Error that indicates that an attempt is being made to access a\nvariable that is not defined. Such errors commonly indicate typos in code, or\nan otherwise broken program.

\n

While client code may generate and propagate these errors, in practice, only V8\nwill do so.

\n
doesNotExist;\n// throws ReferenceError, doesNotExist is not a variable in this program.\n
\n

Unless an application is dynamically generating and running code,\nReferenceError instances should always be considered a bug in the code\nor its dependencies.

\n" }, { "textRaw": "Class: SyntaxError", "type": "class", "name": "SyntaxError", "desc": "

A subclass of Error that indicates that a program is not valid JavaScript.\nThese errors may only be generated and propagated as a result of code\nevaluation. Code evaluation may happen as a result of eval, Function,\nrequire, or vm. These errors are almost always indicative of a broken\nprogram.

\n
try {\n  require('vm').runInThisContext('binary ! isNotOk');\n} catch (err) {\n  // err will be a SyntaxError\n}\n
\n

SyntaxError instances are unrecoverable in the context that created them –\nthey may only be caught by other contexts.

\n" }, { "textRaw": "Class: TypeError", "type": "class", "name": "TypeError", "desc": "

A subclass of Error that indicates that a provided argument is not an\nallowable type. For example, passing a function to a parameter which expects a\nstring would be considered a TypeError.

\n
require('url').parse(() => { });\n// throws TypeError, since it expected a string\n
\n

Node.js will generate and throw TypeError instances immediately as a form\nof argument validation.

\n" } ] } ] }