Skip to main content

Module error_codes

Module error_codes 

Source
Expand description

Session, request, PUBLISH_DONE and stream reset code registries. Error and status code registries defined by MoQT draft-18.

Draft-18 defines four such registries, all listed in Section 15.10 of the draft: Session Termination Error Codes, REQUEST_ERROR Codes, PUBLISH_DONE Codes and Stream Reset Error Codes. Each is transcribed below as one enum.

All four registries reserve the code points matching 0x7f * N + 0x9D for non-negative integer N (that is, 0x9D, 0x11C, …, 0x3fffffffffffffde) for greasing, per Section 14 of the draft. A reserved range is not an assignment, so it gets no variant; from_u64 reports those codes as unknown just like any other unassigned value.

Every from_u64 returns None for a code the draft does not assign. Peers are expected to send codes this draft does not define, and a decoder must survive them.

Section 14 goes further than “must not fail” and states what an unknown code means: receipt of an unknown error code in any of these four contexts MUST be treated as equivalent to that context’s INTERNAL_ERROR, and an endpoint MUST NOT close the session merely because a REQUEST_ERROR or PUBLISH_DONE carried an unknown code. from_u64 deliberately does not apply that equivalence: it reports the code as unrecognized so the caller still knows what arrived on the wire. Substituting INTERNAL_ERROR is the caller’s step, not the decoder’s.

Enums§

PublishDoneStatusCode
PUBLISH_DONE Codes (draft-18 Section 15.10.3).
RequestErrorCode
REQUEST_ERROR Codes (draft-18 Section 15.10.2).
SessionErrorCode
Session Termination Error Codes (draft-18 Section 15.10.1).
StreamResetErrorCode
Stream Reset Error Codes (draft-18 Section 15.10.4).