deno
Deno Errors
Error classes thrown by the Deno runtime, accessible as Deno.errors.*. These wrap operating-system and I/O errors with descriptive names, making it easy to handle specific failure modes with instanceof checks.
24 codes
references docs.deno.com/api/deno/~/Deno.errors
· All codes 24 codes
- AddrInUse Address In Use The TCP or UDP port is already bound by another process. Choose a different port, or stop the process currently holding the binding. Corresponds to the EADDRINUSE errno.
- AddrNotAvailable Address Not Available The requested local address is not available on this machine. The IP address may not be assigned to any network interface, or the port is outside the allowed ephemeral range.
- AlreadyExists Already Exists A create operation failed because the target path already exists. Use a flag such as { create: true, truncate: true } when opening files, or check for existence before creating. Corresponds to EEXIST.
- BadResource Bad Resource An operation referenced a resource ID (RID) that does not exist or has already been closed. Ensure the resource is still open before using it, and avoid double-closing.
- BrokenPipe Broken Pipe A write was attempted on a pipe, socket, or FIFO whose read end has been closed. This commonly occurs when piping output to a command that exits early (e.g. head). Corresponds to EPIPE.
- Busy Busy A resource is currently in use and cannot be operated on. For example, a listener that is already being iterated, or a file locked by another operation.
- ConnectionAborted Connection Aborted The connection was aborted before it could complete. The remote side closed the connection without a proper handshake, or a timeout caused the OS to abort it.
- ConnectionRefused Connection Refused The remote host actively refused the TCP connection. The target server is not listening on the given port or a firewall rule is blocking the connection.
- ConnectionReset Connection Reset An established connection was forcibly closed by the remote peer. The server or an intermediate network device sent a TCP RST, often due to an application crash or protocol violation.
- FilesystemLoop Filesystem Loop Too many levels of symbolic links were encountered while resolving a path, indicating a symlink cycle. Remove or fix the circular symbolic links. Corresponds to ELOOP.
- Http HTTP Error A generic error originating from Deno's HTTP server or client implementation. Inspect the cause property for the underlying error, and check the request or response for details.
- Interrupted Interrupted A blocking system call was interrupted by a signal before it could complete. The operation should generally be retried. Corresponds to EINTR.
- InvalidData Invalid Data Data read from a stream or file is not valid for the expected format, such as malformed UTF-8 text or a corrupted binary structure.
- IsADirectory Is A Directory A file operation was attempted on a path that is a directory. Use Deno.readDir for directories, or ensure the path points to a file. Corresponds to EISDIR.
- NetworkUnreachable Network Unreachable The network is unreachable from this host. There is no route to the destination, the network interface is down, or the host has no network connectivity. Corresponds to ENETUNREACH.
- NotADirectory Not A Directory A directory operation was attempted on a path that is not a directory. Check the type of the path with Deno.stat before performing directory-specific operations. Corresponds to ENOTDIR.
- NotCapable Not Capable The Deno runtime lacks the capability needed for the operation, typically because the binary was compiled without a required feature. This is distinct from PermissionDenied, which relates to runtime permission flags.
- NotConnected Not Connected An operation requiring an active connection was attempted on a socket that is not connected. Call connect() before reading or writing, or check that the connection has not already been closed.
- NotFound Not Found The requested file, directory, or resource does not exist. Corresponds to the operating-system ENOENT errno.
- NotSupported Not Supported The operation is not supported on this platform or for this type of resource. This can occur when using platform-specific APIs on an unsupported OS.
- PermissionDenied Permission Denied The process does not have the required Deno permission (e.g. --allow-read, --allow-write, --allow-net) or the operating-system denied access. Grant the appropriate permission flag or check file/directory ownership.
- TimedOut Timed Out An operation did not complete within the allowed time. This can be raised by Deno.connect with a deadline option, or by an AbortSignal with a timeout. Corresponds to ETIMEDOUT.
- UnexpectedEof Unexpected EOF A stream or file ended before the expected amount of data was read. The source may have been truncated, the connection dropped, or the protocol framing is incorrect.
- WriteZero Write Zero A write operation wrote zero bytes when a non-zero amount was expected. This indicates the sink is no longer accepting data and the write should be retried or the connection closed.