Skip to main content

Module error_codes

Module error_codes 

Source
Expand description

Error and status code registries defined by draft-17.

One enum per IANA registry in Section 14.5 of the draft. Variant names are the draft’s own ALLCAPS names rewritten in Rust convention; each variant’s doc comment repeats the draft spelling so the mapping stays checkable.

Codes are per-registry, not global, and the overlap is not benign: every value from 0x0 to 0x5 is assigned in all four registries, with a different meaning in nearly every cell.

codesession terminationREQUEST_ERRORPUBLISH_DONEdata stream reset
0x0NO_ERRORINTERNAL_ERRORINTERNAL_ERRORINTERNAL_ERROR
0x1INTERNAL_ERRORUNAUTHORIZEDUNAUTHORIZEDCANCELLED
0x2UNAUTHORIZEDTIMEOUTTRACK_ENDEDDELIVERY_TIMEOUT
0x3PROTOCOL_VIOLATIONNOT_SUPPORTEDSUBSCRIPTION_ENDEDSESSION_CLOSED
0x4INVALID_REQUEST_IDMALFORMED_AUTH_TOKENGOING_AWAYUNKNOWN_OBJECT_STATUS
0x5DUPLICATE_TRACK_ALIASEXPIRED_AUTH_TOKENEXPIREDTOO_FAR_BEHIND
0x9MALFORMED_PATHEXCESSIVE_LOADEXCESSIVE_LOADEXCESSIVE_LOAD
0x12DATA_STREAM_TIMEOUTMALFORMED_TRACKMALFORMED_TRACKMALFORMED_TRACK
0x19INVALID_AUTHORITYDUPLICATE_SUBSCRIPTIONunassignedunassigned

Carrying a value from one of these types to another is therefore always a bug, even where the two happen to share a variant name. These type names also recur in the sibling draft modules over different assignments, so an import repointed at another draft still compiles while changing meaning.

Every table’s last row reserves 0x7f * N + 0x9D for greasing (Section 13). Those code points carry no semantics, get no variants here, and are rejected by from_u64 like any other unassigned value. Note that Section 13 of this draft gives the formula as 0x7f * N + 0x9D but illustrates it with the sequence 0x9D, 0xBC, ..., whose step is 0x1f rather than 0x7f; drafts 18 and 19 keep the same formula and correct the illustration to 0x9D, 0x11C, .... The formula is treated as normative. Either reading leaves this module unchanged, since no greasing value gets a variant.

Enums§

DataStreamResetErrorCode
Data Stream Reset Error Codes (draft-17, Section 14.5.4).
PublishDoneStatusCode
PUBLISH_DONE Codes (draft-17, Section 14.5.3).
RequestErrorCode
REQUEST_ERROR Codes (draft-17, Section 14.5.2).
SessionErrorCode
Session Termination Error Codes (draft-17, Section 14.5.1).