diff --git a/proposals/sockets/wit-0.3.0-draft/ip-name-lookup.wit b/proposals/sockets/wit-0.3.0-draft/ip-name-lookup.wit index a234eef4..8e6bcfa8 100644 --- a/proposals/sockets/wit-0.3.0-draft/ip-name-lookup.wit +++ b/proposals/sockets/wit-0.3.0-draft/ip-name-lookup.wit @@ -5,13 +5,7 @@ interface ip-name-lookup { /// Lookup error codes. @since(version = 0.3.0-rc-2026-02-09) - enum error-code { - /// Unknown error - /// - /// This is an escape hatch for WASI implementations to handle failures - /// that can not be categorized under any of the other error codes. - unknown, - + variant error-code { /// Access denied. /// /// POSIX equivalent: EACCES, EPERM @@ -36,6 +30,11 @@ interface ip-name-lookup { /// /// POSIX equivalent: EAI_FAIL permanent-resolver-failure, + + /// A catch-all for errors not captured by the existing variants. + /// Implementations can use this to extend the error type without + /// breaking existing code. + other(option), } /// Resolve an internet host name to a list of IP addresses. diff --git a/proposals/sockets/wit-0.3.0-draft/types.wit b/proposals/sockets/wit-0.3.0-draft/types.wit index 9cb8299b..c6725efe 100644 --- a/proposals/sockets/wit-0.3.0-draft/types.wit +++ b/proposals/sockets/wit-0.3.0-draft/types.wit @@ -15,13 +15,7 @@ interface types { /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. @since(version = 0.3.0-rc-2026-02-09) - enum error-code { - /// Unknown error. - /// - /// This is an escape hatch for WASI implementations to handle failures - /// that can not be categorized under any of the other error codes. - unknown, - + variant error-code { /// Access denied. /// /// POSIX equivalent: EACCES, EPERM @@ -91,6 +85,11 @@ interface types { /// /// POSIX equivalent: EMSGSIZE datagram-too-large, + + /// A catch-all for errors not captured by the existing variants. + /// Implementations can use this to extend the error type without + /// breaking existing code. + other(option), } @since(version = 0.3.0-rc-2026-02-09)