flix

0.73.0

Util.Json.JsonError

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

An error that can occur when parsing or decoding JSON.

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

instance Eq[JsonError]Source
instance Formattable[JsonError]Source
instance ToString[JsonError]Source

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.