Skip to main content

WIRE_ERROR_CODES

Constant WIRE_ERROR_CODES 

Source
pub const WIRE_ERROR_CODES: &[&str];
Expand description

The closed set of wire-level error codes for protocol version 1 (ADR-137, “Wire error taxonomy”).

The set is closed within a protocol version: adding a code requires a protocol version bump (crate::version). Serialized names are snake_case and match the ADR exactly.

A decoder that encounters a code string it does not recognize falls back to WireErrorCode::Internal per the ADR: “a client that receives a code it does not recognize must treat it as internal — request-terminal, retriable only under the caller’s own policy — rather than inventing semantics for it.” This is implemented with #[serde(other)], so an older client talking to a server that has gained a new code under a later protocol version degrades to this documented behavior instead of a decode failure. The wire (snake_case) names of every code in the closed set for protocol version 1, in ADR-137’s “Wire error taxonomy” table order.

The codec’s decode-time error-scope check applies only to codes in this set: their terminal scopes are fixed by the table. A code outside the set fell back to WireErrorCode::Internal via #[serde(other)]; its true scope is unknown to this protocol version, and ADR-137 directs the client to treat it as internal rather than reject the frame. Code names are case-sensitive: a case-variant of a known code ("Cancelled") is simply an unknown code string and takes the same documented fallback — the exemption is one rule, not a bypass of the closed set.