Module

Codec.Json.Errors.AnsiDodoError

Package
purescript-json-codecs
Repository
jordanmartinez/purescript-json-codecs

Defines the handlers and other utilities for when you want a Doc-based error with colors.

#AnsiDodoErrorColors Source

type AnsiDodoErrorColors = { errorMessage :: Color, errorPath :: Color, errorText :: Color, hintCtor :: Color, hintField :: Color, hintPath :: Color, hintSubterm :: Color, hintText :: Color, hintType :: Color }

Defines what color to use with each part of the error message. Given an error message below, the number below each character indicates the color used for that text when rendering an AnsiDodoError using handlersAde'.:

while decoding the type, Type, at path: ROOT.foo
444444444444444444444444455554444444444466666666

  received empty string at path: ROOT.foo
  111111111111111111111222222222233333333

Colors in parenthesis after label indicate the color
found in `defaultAnsiDodoErrorColors`.
1 = errorMessage (BrightRed)
2 = errorText (White)
3 = errorPath (BrightCyan)
4 = hintText (White)
5 = hintType/hintCtor/hintSubterm/hintField (Yellow)
6 = hintPath (Cyan)

#defaultAnsiDodoErrorColors Source

defaultAnsiDodoErrorColors :: AnsiDodoErrorColors

See AnsiDodoErrorColors' docs

#runJsonDecoderADE' Source

runJsonDecoderADE' :: forall a extra. extra -> Json -> JsonDecoder (Doc GraphicsParam) extra a -> Either (Doc GraphicsParam) a

#decodeAde' Source

decodeAde' :: forall a extra. extra -> Json -> JsonCodec (Doc GraphicsParam) extra a -> Either (Doc GraphicsParam) a

#adeD Source

adeD :: forall from to. JsonDecoder' (Doc GraphicsParam) Unit from to -> JsonDecoder' (Doc GraphicsParam) Unit from to

#adeC Source

adeC :: forall from to. JsonCodec' (Doc GraphicsParam) Unit from to -> JsonCodec' (Doc GraphicsParam) Unit from to