Errors | Node.js v26.8.2 Documentation

nodejs.org

Tin mới

About this documentation

Asynchronous context tracking

C/C++ addons with Node-API

Command-line options

Diagnostics Channel

Environment Variables

Internationalization

Iterable Streams API

Modules: CommonJS modules

Modules: ECMAScript modules

Modules: node:module API

Modules: TypeScript

Single executable applications

Virtual File System

View on single page

Error propagation and interception#

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

Error propagation and interception#

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

event emitter-based

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

'uncaughtException'

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

Error propagation and interception#

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

Class: assert.AssertionError

Indicates the failure of an assertion. For details, see Class: assert.AssertionError.

Class: SyntaxError#

Indicates that a program is not valid JavaScript. These errors may only be generated and propagated as a result of code evaluation. Code evaluation may happen as a result of eval, Function, require, or vm. These errors a

util.getSystemErrorName(error.errno)

The error.errno property is a negative number which corresponds to the error code defined in libuv Error handling.

ERR_ACCESS_DENIED#

A special type of error that is triggered whenever Node.js tries to get access to a resource restricted by the Permission Model.

require('node:crypto').setEngine()

An invalid crypto engine identifier was passed to require('node:crypto').setEngine().

ERR_DEBUGGER_ERROR#

v8.startupSnapshot.setDeserializeMainFunction()

v8.startupSnapshot.setDeserializeMainFunction() could not be called because it had already been called before.

ERR_HTTP_SOCKET_ASSIGNED#

The given ServerResponse was already assigned a socket.

ERR_INVALID_HANDLE_TYPE#

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

ERR_INVALID_PACKAGE_CONFIG#

ERR_INVALID_REPL_EVAL_CONFIG#

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

ERR_INVALID_TUPLE#

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

ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE#

A message posted to a MessagePort could not be deserialized in the target vm Context. Not all Node.js objects can be successfully instantiated in any context at this time, and attempting to transfer them using postMessag

ERR_QUIC_STREAM_ABORTED#

The Node.js error code for a QuicError thrown to abort a QUIC stream or session with an explicit application or transport error code.

ERR_SERVER_ALREADY_LISTEN#

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

dgram.createSocket()

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

ERR_ZIP_ENTRY_NOT_FOUND#

A named entry was requested from a ZipFile or ZipBuffer that does not contain an entry with that name.