XdrJsonError

public enum XdrJsonError : Error, Sendable

Errors raised while converting between XDR values and XDR-JSON.

Every case names the type being converted and, where one applies, the offending key, so a failure deep inside a transaction envelope can be located without re-running the conversion.

Payloads carry the offending text verbatim, so a caller can act on it. message is where the four cases whose payload comes from the document – a duplicate key, an unknown enumeration value, an unknown union arm and an undeclared field – neutralise it through XdrJson/preview(_:), so an error echoed into a terminal or a log cannot carry escape sequences of its own.