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
#docifyPath Source
docifyPath :: Color -> Color -> Array JsonOffset -> Doc GraphicsParam
#docifyHint Source
docifyHint :: Color -> Color -> Array JsonOffset -> Doc GraphicsParam -> Doc GraphicsParam -> Doc GraphicsParam
#runJsonDecoderADE Source
runJsonDecoderADE :: forall a. Json -> JsonDecoder (Doc GraphicsParam) Unit a -> Either (Doc GraphicsParam) a
#runJsonDecoderADE' Source
runJsonDecoderADE' :: forall a extra. extra -> Json -> JsonDecoder (Doc GraphicsParam) extra a -> Either (Doc GraphicsParam) a
#decodeAde Source
decodeAde :: forall a. Json -> JsonCodec (Doc GraphicsParam) Unit 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
- Modules
- Codec.
Codec - Codec.
Decoder - Codec.
Decoder. Qualified - Codec.
Json. Bidirectional. Class - Codec.
Json. Bidirectional. Value - Codec.
Json. Errors. AnsiDodoError - Codec.
Json. Errors. DecodeMessages - Codec.
Json. Errors. NoError - Codec.
Json. Errors. PlainDodoError - Codec.
Json. Errors. PrimitiveJsonError - Codec.
Json. Errors. Tree - Codec.
Json. JsonCodec - Codec.
Json. JsonDecoder - Codec.
Json. Newtypes - Codec.
Json. Types - Codec.
Json. Unidirectional. Decode. Class - Codec.
Json. Unidirectional. Decode. Value - Codec.
Json. Unidirectional. Encode. Class - Codec.
Json. Unidirectional. Encode. Value - Data.
V. Semigroup. Qualified