Variant
error-code
Error codes.
variant error-code {
access-denied,
not-supported,
invalid-argument,
out-of-memory,
timeout,
invalid-state,
address-not-bindable,
address-in-use,
remote-unreachable,
connection-refused,
connection-broken,
connection-reset,
connection-aborted,
datagram-too-large,
other(option<string>),
}Cases
| Case | Payload | Description |
|---|---|---|
| access-denied | — | Access denied. |
| not-supported | — | The operation is not supported. |
| invalid-argument | — | One of the arguments is invalid. |
| out-of-memory | — | Not enough memory to complete the operation. |
| timeout | — | The operation timed out before it could finish completely. |
| invalid-state | — | The operation is not valid in the socket's current state. |
| address-not-bindable | — | The local address is not available. |
| address-in-use | — | A bind operation failed because the provided address is already in use or because there are no ephemeral ports available. |
| remote-unreachable | — | The remote address is not reachable. |
| connection-refused | — | The connection was forcefully rejected. |
| connection-broken | — | A write failed because the connection was broken. |
| connection-reset | — | The connection was reset. |
| connection-aborted | — | The connection was aborted. |
| datagram-too-large | — | The size of a datagram sent to a UDP socket exceeded the maximum supported size. |
| 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. |