flix

0.79.0

JsonError

Type of JSON parsing and decoding errors, and its functions.

enum JsonError with EqSource
case Parse(Int32, ParseErrorKind)
case Decode(JsonPath, DecodeErrorKind)

Type of JSON parsing and decoding errors.

Parse wraps a parser failure together with the UTF-16 code-unit offset into the input where the failure was detected.

Decode wraps a decoder failure together with the path of the failing value inside the parsed Json document.

Instances

Eq, Formattable, ToString

Definitions

def prependPath(p: JsonPath, e: JsonError): JsonError§ Source

Prepends the steps of p to the path of e if e is a Decode. Leaves Parse errors unchanged.

Used to stitch a leaf decoder's inner path onto a navigation prefix when decoding at a multi-step path.

def prependStep(s: JsonStep, e: JsonError): JsonError§ Source

Prepends s to the path of e if e is a Decode. Leaves Parse errors unchanged.

Used by FromJson helpers and recursive instances to thread the path of a failing decode lazily — i.e. only on the error path.