Variant
error-code
Error codes returned by functions, similar to errno in POSIX.
Not all of these error codes are returned by the functions provided by this
API; some are used in higher-level library layers, and others are provided
merely for alignment with POSIX.
variant error-code {
access,
already,
bad-descriptor,
busy,
deadlock,
quota,
exist,
file-too-large,
illegal-byte-sequence,
in-progress,
interrupted,
invalid,
io,
is-directory,
loop,
too-many-links,
message-size,
name-too-long,
no-device,
no-entry,
no-lock,
insufficient-memory,
insufficient-space,
not-directory,
not-empty,
not-recoverable,
unsupported,
no-tty,
no-such-device,
overflow,
not-permitted,
pipe,
read-only,
invalid-seek,
text-file-busy,
cross-device,
other(option<string>),
}Cases
| Case | Payload | Description |
|---|---|---|
| access | — | Permission denied, similar to EACCES in POSIX. |
| already | — | Connection already in progress, similar to EALREADY in POSIX. |
| bad-descriptor | — | Bad descriptor, similar to EBADF in POSIX. |
| busy | — | Device or resource busy, similar to EBUSY in POSIX. |
| deadlock | — | Resource deadlock would occur, similar to EDEADLK in POSIX. |
| quota | — | Storage quota exceeded, similar to EDQUOT in POSIX. |
| exist | — | File exists, similar to EEXIST in POSIX. |
| file-too-large | — | File too large, similar to EFBIG in POSIX. |
| illegal-byte-sequence | — | Illegal byte sequence, similar to EILSEQ in POSIX. |
| in-progress | — | Operation in progress, similar to EINPROGRESS in POSIX. |
| interrupted | — | Interrupted function, similar to EINTR in POSIX. |
| invalid | — | Invalid argument, similar to EINVAL in POSIX. |
| io | — | I/O error, similar to EIO in POSIX. |
| is-directory | — | Is a directory, similar to EISDIR in POSIX. |
| loop | — | Too many levels of symbolic links, similar to ELOOP in POSIX. |
| too-many-links | — | Too many links, similar to EMLINK in POSIX. |
| message-size | — | Message too large, similar to EMSGSIZE in POSIX. |
| name-too-long | — | Filename too long, similar to ENAMETOOLONG in POSIX. |
| no-device | — | No such device, similar to ENODEV in POSIX. |
| no-entry | — | No such file or directory, similar to ENOENT in POSIX. |
| no-lock | — | No locks available, similar to ENOLCK in POSIX. |
| insufficient-memory | — | Not enough space, similar to ENOMEM in POSIX. |
| insufficient-space | — | No space left on device, similar to ENOSPC in POSIX. |
| not-directory | — | Not a directory or a symbolic link to a directory, similar to ENOTDIR in POSIX. |
| not-empty | — | Directory not empty, similar to ENOTEMPTY in POSIX. |
| not-recoverable | — | State not recoverable, similar to ENOTRECOVERABLE in POSIX. |
| unsupported | — | Not supported, similar to ENOTSUP and ENOSYS in POSIX. |
| no-tty | — | Inappropriate I/O control operation, similar to ENOTTY in POSIX. |
| no-such-device | — | No such device or address, similar to ENXIO in POSIX. |
| overflow | — | Value too large to be stored in data type, similar to EOVERFLOW in POSIX. |
| not-permitted | — | Operation not permitted, similar to EPERM in POSIX. |
| pipe | — | Broken pipe, similar to EPIPE in POSIX. |
| read-only | — | Read-only file system, similar to EROFS in POSIX. |
| invalid-seek | — | Invalid seek, similar to ESPIPE in POSIX. |
| text-file-busy | — | Text file busy, similar to ETXTBSY in POSIX. |
| cross-device | — | Cross-device link, similar to EXDEV in POSIX. |
| other | option<string> | A catch-all for errors not captured by the existing variants. Implementations can use this to extend the error type without breaking existing code. |