Skip to content
Strata is pre-1.0. APIs, protocol, and storage format may change.

strata_protocol/error

Decode errors shared by the client and server frame decoders.

An error that occurred while decoding a Strata frame.

pub type DecodeError {
InvalidJson(reason: String)
InvalidFormat(reason: String)
UnsupportedVersion(found: Int, expected: Int)
UnknownKind(kind: String)
}

Raw JSON parse failed.

JSON parsed but did not match the expected frame shape.

UnsupportedVersion(found: Int, expected: Int)

Section titled “UnsupportedVersion(found: Int, expected: Int)”

Frame's v field disagrees with this protocol version.

Frame's kind field is not recognised for this direction.

Format a DecodeError as a single human-readable line.

pub fn format(DecodeError) -> String

Translate a gleam/json.DecodeError into a strata DecodeError.

pub fn json_error_to_decode_error(json.DecodeError) -> DecodeError