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 areason enum and the
errnocaptured at the production site, plusStatusaliases 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
Reason a stream send operation (TCP, Unix, Pipe) failed.
Retryability and fatality:
PRESSURE— Retryable: wait for theonWritablecallback, thenretry.
CLOSED— Fatal: the connection cannot be reused.ERROR— Depends onerrno; check it for EINTR/EAGAIN-classconditions.
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.
SendErrorReason reasonWhy the send failed.int errnoOS error code captured at the production site (0 when not applicable).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 onerrno.
ConnectErrorReason reasonWhy the connect failed.int errnoOS error code captured at the production site (0 when not applicable).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 adifferent port.
PERMISSION_DENIED— Fatal: requires elevated privileges or adifferent port.
ADDRESS_NOT_AVAILABLE— Fatal on this host.RESOURCE_LIMIT— Retryable after freeing descriptors.ERROR— Depends onerrno.
ListenErrorReason reasonWhy the listen failed.int errnoOS error code captured at the production site (0 when not applicable).Reason a handle adoption operation (TCP, Unix) failed.
Retryability and fatality:
INVALID_HANDLE— Fatal: the handle is invalid.REGISTRATION_FAILED— Retryable after freeing event loopresources.
RESOURCE_LIMIT— Retryable after freeing resources.ERROR— Depends onerrno.
AdoptErrorReason reasonWhy the adoption failed.int errnoOS error code captured at the production site (0 when not applicable).Reason a file open operation failed.
Retryability and fatality:
INVALID_ARGUMENT— Fatal: fix the arguments.NOT_FOUND— Fatal for reading; retryable for writing with acreate flag.
PERMISSION_DENIED— Fatal: requires permission changes.IS_DIRECTORY— Fatal: the path names a directory.TOO_MANY_FILES— Retryable after closing files.ERROR— Depends onerrno.
OpenErrorReason reasonWhy the open failed.int errnoOS error code captured at the production site (0 when not applicable).Success-payload outcome of an asynchronous file read or write submission.
Reason an asynchronous file read or write failed.
Retryability and fatality:
ERROR— Depends onerrno; check it for EINTR/EIO-classconditions.
CLOSED— Fatal: the file handle cannot be reused.
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 onerrno; check it for EINTR/EMSGSIZE-classconditions.
DatagramErrorReason reasonWhy the send failed.int errnoOS error code captured at the production site (0 when not applicable).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 loopresources.
ERROR— Depends on the OS error; seeerrno.
StartErrorReason reasonWhy the start failed.int errnoOS error code captured at the production site (0 when not applicable).Reason an async splice operation failed.
SpliceErrorReason reasonWhy the splice failed.int errnoOS error code captured at the production site (0 when not applicable).State of a socket (TCP or Unix).
Used by TcpConnection and UnixConnection.
State of an async file.
Used by AsyncFile.
State of a pipe endpoint.
Used by Pipe.
State of console input (Windows).
Used by ConsoleInput.
Reason a socket was closed.
Used by TcpConnection and UnixConnection close callbacks.
Reason a pipe was closed.
Used by Pipe close callbacks.