Ende.errors

namespace

namespace Ende.errors

A set of error constructors that are raised by Ende APIs.

Can be used to provide more specific handling of failures within code which is using Ende APIs. For example, handling attempting to open a file which does not exist:

try {
  const file = await Ende.open("./some/file.txt");
} catch (error) {
  if (error instanceof Ende.errors.NotFound) {
    console.error("the file was not found");
  } else {
    // otherwise re-throw
    throw error;
  }
}

Members

  • Ende.errors.NotFound — Raised when the underlying operating system indicates that the file was not found.
  • Ende.errors.PermissionDenied — Raised when the underlying operating system indicates the current user which the Ende process is running under does not have the appropriate permissions to a file or resource.
  • Ende.errors.ConnectionRefused — Raised when the underlying operating system reports that a connection to a resource is refused.
  • Ende.errors.ConnectionReset — Raised when the underlying operating system reports that a connection has been reset. With network servers, it can be a _normal_ occurrence where a client will abort a connection instead of properly shutting it down.
  • Ende.errors.ConnectionAborted — Raised when the underlying operating system reports an `ECONNABORTED` error.
  • Ende.errors.NotConnected — Raised when the underlying operating system reports an `ENOTCONN` error.
  • Ende.errors.AddrInUse — Raised when attempting to open a server listener on an address and port that already has a listener.
  • Ende.errors.AddrNotAvailable — Raised when the underlying operating system reports an `EADDRNOTAVAIL` error.
  • Ende.errors.BrokenPipe — Raised when trying to write to a resource and a broken pipe error occurs. This can happen when trying to write directly to `stdout` or `stderr` and the operating system is unable to pipe the output for a reason external to the Ende runtime.
  • Ende.errors.AlreadyExists — Raised when trying to create a resource, like a file, that already exits.
  • Ende.errors.InvalidData — Raised when an operation returns data that is invalid for the operation being performed.
  • Ende.errors.TimedOut — Raised when the underlying operating system reports that an I/O operation has timed out (`ETIMEDOUT`).
  • Ende.errors.Interrupted — Raised when the underlying operating system reports an `EINTR` error. In many cases, this underlying IO error will be handled internally within Ende, or result in an BadResource error instead.
  • Ende.errors.WouldBlock — Raised when the underlying operating system would need to block to complete but an asynchronous (non-blocking) API is used.
  • Ende.errors.WriteZero — Raised when expecting to write to a IO buffer resulted in zero bytes being written.
  • Ende.errors.UnexpectedEof — Raised when attempting to read bytes from a resource, but the EOF was unexpectedly encountered.
  • Ende.errors.BadResource — The underlying IO resource is invalid or closed, and so the operation could not be performed.
  • Ende.errors.Http — Raised in situations where when attempting to load a dynamic import, too many redirects were encountered.
  • Ende.errors.Busy — Raised when the underlying IO resource is not available because it is being awaited on in another block of code.
  • Ende.errors.NotSupported — Raised when the underlying Ende API is asked to perform a function that is not currently supported.
  • Ende.errors.FilesystemLoop — Raised when too many symbolic links were encountered when resolving the filename.
  • Ende.errors.IsADirectory — Raised when trying to open, create or write to a directory.
  • Ende.errors.NetworkUnreachable — Raised when performing a socket operation but the remote host is not reachable.
  • Ende.errors.NotADirectory — Raised when trying to perform an operation on a path that is not a directory, when directory is required.
  • Ende.errors.NotCapable — Raised when trying to perform an operation while the relevant Ende permission (like `--allow-read`) has not been granted.