eve.aio.errors

Operation errors, result payloads and enums for EVE AIO.

This module centralizes everything the AIO transports and files use to report operation outcomes, so the POSIX, Linux and Windows implementations agree on one vocabulary:

  • Result-based error payloads (SendError, ConnectError, …) with a

    reason enum and the errno captured at the production site, plus Status aliases such as SendStatus and success-payload outcome enums such as FileOutcome.

  • Centralized errno / Winsock error mappers used by every platform

    implementation.

  • The operation-result, state and close-reason enums. The

    operation-result enums are legacy: they are retained unchanged while the AIO APIs move to Result-based returns and are removed as each operation is converted. New code should use the error payloads.

Portable error handling example (once an operation returns a Status):

import eve.aio.errors: SendErrorReason;

// if (!conn.send(buf).ok()) {
//    auto failure = ...error();
//    if (failure.reason == SendErrorReason.PRESSURE)
//       ... // wait for onWritable, then retry
// }

Types 34

enumSendErrorReason : ubyte

Reason a stream send operation (TCP, Unix, Pipe) failed.

Retryability and fatality:

  • PRESSURE — Retryable: wait for the onWritable callback, then

    retry.

  • CLOSED — Fatal: the connection cannot be reused.
  • ERROR — Depends on errno; check it for EINTR/EAGAIN-class

    conditions.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
PRESSURESend budget exceeded; zero bytes were queued. Wait for `onWritable`.
CLOSEDThe connection is not in the CONNECTED state.
ERRORSystem error; see `errno`.
structSendError

Recoverable failure of a stream send operation (TCP, Unix, Pipe).

The errno field carries the OS error captured when the failure occurred; callers must not read the global errno later.

Fields
SendErrorReason reasonWhy the send failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumConnectErrorReason : ubyte

Reason a connect operation (TCP, Unix) failed.

Retryability and fatality:

  • INVALID_ARGUMENT — Fatal: fix the arguments.
  • CONNECTION_REFUSED — Retryable with exponential backoff.
  • NETWORK_UNREACHABLE — Retryable after connectivity is restored.
  • HOST_UNREACHABLE — Retryable with backoff.
  • TIMED_OUT — Retryable with a longer timeout.
  • RESOURCE_LIMIT — Retryable after freeing resources.
  • ERROR — Depends on errno.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
INVALID_ARGUMENTInvalid host, port, or path argument.
CONNECTION_REFUSEDConnection refused by the remote host.
NETWORK_UNREACHABLENetwork is unreachable.
HOST_UNREACHABLEHost is unreachable.
TIMED_OUTConnection attempt timed out.
RESOURCE_LIMITSystem resource limit reached.
ERRORUnspecified system error; see `errno`.
Fields
ConnectErrorReason reasonWhy the connect failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumListenErrorReason : ubyte

Reason a listen/bind operation (TCP, Unix) failed.

Retryability and fatality:

  • INVALID_ARGUMENT — Fatal: fix the arguments.
  • ADDRESS_IN_USE — Retryable after the port/path is freed or with a

    different port.

  • PERMISSION_DENIED — Fatal: requires elevated privileges or a

    different port.

  • ADDRESS_NOT_AVAILABLE — Fatal on this host.
  • RESOURCE_LIMIT — Retryable after freeing descriptors.
  • ERROR — Depends on errno.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
INVALID_ARGUMENTInvalid host, port, or path argument.
ADDRESS_IN_USEAddress or port is already in use.
PERMISSION_DENIEDPermission denied (e.g. port < 1024 requires privileges).
ADDRESS_NOT_AVAILABLERequested address is not available on this host.
RESOURCE_LIMITSystem resource limit reached.
ERRORUnspecified system error; see `errno`.
Fields
ListenErrorReason reasonWhy the listen failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumAdoptErrorReason : ubyte

Reason a handle adoption operation (TCP, Unix) failed.

Retryability and fatality:

  • INVALID_HANDLE — Fatal: the handle is invalid.
  • REGISTRATION_FAILED — Retryable after freeing event loop

    resources.

  • RESOURCE_LIMIT — Retryable after freeing resources.
  • ERROR — Depends on errno.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
INVALID_HANDLEInvalid handle provided.
REGISTRATION_FAILEDFailed to register with the event loop.
RESOURCE_LIMITSystem resource limit reached.
ERRORUnspecified system error; see `errno`.
Fields
AdoptErrorReason reasonWhy the adoption failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumOpenErrorReason : ubyte

Reason a file open operation failed.

Retryability and fatality:

  • INVALID_ARGUMENT — Fatal: fix the arguments.
  • NOT_FOUND — Fatal for reading; retryable for writing with a

    create flag.

  • PERMISSION_DENIED — Fatal: requires permission changes.
  • IS_DIRECTORY — Fatal: the path names a directory.
  • TOO_MANY_FILES — Retryable after closing files.
  • ERROR — Depends on errno.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
INVALID_ARGUMENTInvalid path or flags argument.
NOT_FOUNDFile or directory not found.
PERMISSION_DENIEDPermission denied.
IS_DIRECTORYPath is a directory, not a file.
TOO_MANY_FILESToo many open files in the system.
ERRORUnspecified system error; see `errno`.
structOpenError
Fields
OpenErrorReason reasonWhy the open failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumFileOutcome : ubyte

Success-payload outcome of an asynchronous file read or write submission.

COMPLETED = 0The operation already finished; the result is available now.
PENDINGThe operation was queued; the completion callback will fire.
enumFileErrorReason : ubyte

Reason an asynchronous file read or write failed.

Retryability and fatality:

  • ERROR — Depends on errno; check it for EINTR/EIO-class

    conditions.

  • CLOSED — Fatal: the file handle cannot be reused.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
ERRORSystem error during or while queueing the operation; see `errno`.
CLOSEDThe file has been closed.
structFileError
Fields
FileErrorReason reasonWhy the operation failed.
int errnoOS error code captured at the production site (0 when not applicable).

Reason a datagram send operation (UDP) failed.

Retryability and fatality:

  • NOT_READY — Retryable after the socket is bound.
  • WOULD_BLOCK — Retryable immediately or after a brief delay.
  • ERROR — Depends on errno; check it for EINTR/EMSGSIZE-class

    conditions.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
NOT_READYSocket is not bound or not ready.
WOULD_BLOCKSend would block; retry later.
ERRORUnspecified system error; see `errno`.
Fields
DatagramErrorReason reasonWhy the send failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumStartErrorReason : ubyte

Reason a console input start operation (Windows) failed.

Retryability and fatality:

  • INVALID_STATE — Fatal: console already started or disposed.
  • INVALID_HANDLE — Fatal: no console handle available.
  • REGISTRATION_FAILED — Retryable after freeing event loop

    resources.

  • ERROR — Depends on the OS error; see errno.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
INVALID_STATEInvalid state (already started or disposed).
INVALID_HANDLEFailed to get a console handle.
REGISTRATION_FAILEDFailed to register with the event loop.
ERRORUnspecified system error; see `errno`.
Fields
StartErrorReason reasonWhy the start failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumSpliceErrorReason : ubyte

Reason an async splice operation failed.

UNSPECIFIED = 0Not a real domain error; the default-constructed payload value.
WOULD_BLOCKOperation would block (non-blocking mode, no data available).
INVALID_FDInvalid file descriptors (neither is a pipe).
IO_ERRORI/O error during splice; see `errno`.
CANCELLEDOperation was cancelled.
NOT_SUPPORTEDSplice not supported on this platform.
Fields
SpliceErrorReason reasonWhy the splice failed.
int errnoOS error code captured at the production site (0 when not applicable).
enumSocketState : ubyte

State of a socket (TCP or Unix).

Used by TcpConnection and UnixConnection.

INITInitial state, not yet connected.
CONNECTINGConnection in progress.
CONNECTEDConnected and ready for I/O.
CLOSEDConnection has been closed.
ERRORSocket is in an error state.
enumFileState : ubyte

State of an async file.

Used by AsyncFile.

INITInitial state, not yet opened.
OPENFile is open and ready for operations.
CLOSEDFile has been closed.
ERRORFile is in an error state.
enumPipeState : ubyte

State of a pipe endpoint.

Used by Pipe.

INITInitial state, not yet opened.
OPENPipe is open and ready for I/O.
CLOSEDPipe has been closed.
ERRORPipe is in an error state.
enumConsoleState : ubyte

State of console input (Windows).

Used by ConsoleInput.

INITInitial state, not yet started.
RUNNINGConsole is running and processing input.
STOPPEDConsole has been stopped.
ERRORConsole is in an error state.
enumSocketCloseReason : ubyte

Reason a socket was closed.

Used by TcpConnection and UnixConnection close callbacks.

EOFRemote end closed the connection gracefully.
RESETConnection was reset by remote end.
CLOSEDConnection was closed locally.
ERRORConnection was closed due to an error.
CANCELLEDConnection was cancelled.
enumPipeCloseReason : ubyte

Reason a pipe was closed.

Used by Pipe close callbacks.

EOFRemote end closed the pipe.
CLOSEDPipe was closed locally.
ERRORPipe was closed due to an error.