wt_error (webtransport v0.2.6)

View Source

Application error code mapping (draft-ietf-webtrans-http3-15 §3.3).

WebTransport application error codes are 32-bit integers local to the session. On the wire (QUIC / H/2 capsule) they must be carried as values that do not collide with HTTP/3 reserved error codes of the form 0x1f * N + 0x21. The draft specifies a reversible mapping:

to_quic(App) = WT_APP_ERROR_FIRST + App + App div 30 from_quic(Q) = inverse, or error when Q falls on a reserved slot

The + App div 30 factor reserves one QUIC code per 30 consecutive application codes so the HTTP/3 reserved pattern always lands in a skipped slot.

Summary

Functions

Return the {First, Last} QUIC error code range reserved for WT app errors.

Map a QUIC wire error code back to the application error, or error if out of range.

Map a 32-bit application error code to its QUIC wire representation.

Functions

app_error_range()

-spec app_error_range() -> {non_neg_integer(), non_neg_integer()}.

Return the {First, Last} QUIC error code range reserved for WT app errors.

from_quic(Q)

-spec from_quic(non_neg_integer()) -> {ok, non_neg_integer()} | error.

Map a QUIC wire error code back to the application error, or error if out of range.

to_quic(App)

-spec to_quic(non_neg_integer()) -> non_neg_integer().

Map a 32-bit application error code to its QUIC wire representation.