type Error
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
119# Why the strict codec, TraceId.parse, SpanId.parse or TraceParent.read
120# refused a text, or TraceId.from_bytes or SpanId.from_bytes a list of bytes.
121# Offsets count Bend characters (Unicode code points) from zero at the start
122# of the text, or cells from zero at the start of the list, and the first
123# problem in reading order is reported.
124# UnexpectedEnd{offset} the text ends where a character is required,
125# or the list where a byte is
126# InvalidHex{offset} this character is not a lowercase hex digit
127# InvalidByte{offset} this cell is above 255, so it is not a byte
128# ExpectedSeparator{offset} this character should be "-"
129# TrailingInput{} characters follow a complete value, or cells
130# follow the bytes of an ID
131# ForbiddenVersion{} the version is ff, forbidden by W3C 3.2.2.1
132# UnsupportedVersion{version} a version other than 00, which the strict
133# codec does not read (TraceParent.read reads
134# versions 01 to fe by their known prefix)
135# ZeroId{field} the named ID is all zero, forbidden by W3C
136# 3.2.2.3 and 3.2.2.4
137# ControlCharacter{offset} this character is a control character other
138# than a horizontal tab, which no field value
139# may hold (RFC 9110, section 5.5); only
140# TraceParent.read reports it, in the fields
141# of a later version that it does not read
142type Error is Data:
143 UnexpectedEnd{offset: Nat}
144 InvalidHex{offset: Nat}
145 InvalidByte{offset: Nat}
146 ExpectedSeparator{offset: Nat}
147 TrailingInput{}
148 ForbiddenVersion{}
149 UnsupportedVersion{version: String}
150 ZeroId{field: Field}
151 ControlCharacter{offset: Nat}