Skip to content

ErrorReason

type ErrorReason<'JsonValue> =
    | BadPrimitive of string * 'JsonValue
    | BadPrimitiveExtra of string * 'JsonValue * string
    | BadType of string * 'JsonValue
    | BadField of string * 'JsonValue
    | BadPath of string * 'JsonValue * string
    | TooSmallArray of string * 'JsonValue
    | FailMessage of string
    | BadOneOf of DecoderError<'JsonValue> list
AssemblyRanvier.Wire

Why a decoder failed, and the value it failed on.

Cases

BadPrimitive of string * 'JsonValue

A value of the wrong shape, reported as what was expected.

BadPrimitiveExtra of string * 'JsonValue * string

The same, followed by an extra message.

BadType of string * 'JsonValue

A value which is not of the expected type.

BadField of string * 'JsonValue

An object missing an expected field.

BadPath of string * 'JsonValue * string

An object missing a value at an expected path.

TooSmallArray of string * 'JsonValue

An array with fewer elements than expected.

FailMessage of string

A decoder which failed with a message of its own.

BadOneOf of DecoderError<'JsonValue> list

Every decoder of a oneOf failed.

Properties

member IsBadField: bool
member IsBadOneOf: bool
member IsBadPath: bool
member IsBadPrimitive: bool
member IsBadPrimitiveExtra: bool
member IsBadType: bool
member IsFailMessage: bool
member IsTooSmallArray: bool