flix

0.80.0

JsonError

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

enum JsonError with EqSource
case Parse(Int32, ParseErrorKind)

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

Enums

DecodeErrorKindType of JSON decoder failures.
ParseErrorKindType of JSON parser failures.

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.