Skip to main content

Module error_code

Module error_code 

Source
Expand description

Stable IPC error code constants.

Every RuntimeResponse::Error / RuntimeResponseV2::Error code field produced by the runtime is one of the constants in this module. The codes are frozen for the entire 1.x cycle: existing codes are never renamed, and new codes may only be added (additive).

The runtime constructs error responses exclusively from these constants. Hosts and clients may switch on the string values; the constants are exported so that downstream Rust code does not have to inline string literals.

Constants§

FROZEN_CODES
All frozen error codes in alphabetical order.
HANDLER_INTERNAL_ERROR
Handler reported an internal error (covers all four WIT handler-error variants on the wire for backwards compatibility).
HANDLER_INVALID_OUTPUT
Handler output was not valid JSON.
HANDLER_OUTPUT_TOO_LARGE
Handler output exceeded the host-side size limit.
HANDLER_TIMEOUT
Handler exceeded the wall-clock deadline. Retryable.
HANDLER_TRAP
Handler trapped (unreachable, out-of-bounds, stack overflow, …).
INCOMPATIBLE_API_VERSION
apiVersion was outside [MIN_RUNTIME_API_VERSION, RUNTIME_API_VERSION].
INVALID_CLIENT_IDENTITY
clientName / clientVersion failed length or emptiness checks.
INVALID_JSON
Request body was not valid protocol JSON.
INVALID_REQUEST_ID
requestId was missing, empty, or longer than 128 characters.
NO_INVOKE_HANDLER
Invoke was issued but no handler is registered.
UNSUPPORTED_CAPABILITY
Invoke capability is not in the effective capability set.

Functions§

is_frozen
Returns true if code is one of the frozen 1.x error codes.