Toml.Codec.Error

tomland-1.3.3.3: Bidirectional TOML serialization

Copyright | (c) 2018-2022 Kowainik
License | MPL-2.0
Maintainer | Kowainik <xrom.xkov@gmail.com>
Stability | Stable
Portability | Portable
Safe Haskell | None
Language | Haskell2010

Toml.Codec.Error

Description

Core error types, including `TomlDecodeError` and `LoadTomlException`.

Since: 1.3.0.0

Synopsis

- data TomlDecodeError
  - = BiMapError !Key !TomlBiMapError
  - | KeyNotFound !Key
  - | TableNotFound !Key
  - | TableArrayNotFound !Key
  - | ParseError !TomlParseError
  - | NotExactDecode !TOML
- prettyTomlDecodeErrors :: [TomlDecodeError] -> Text
- prettyTomlDecodeError :: TomlDecodeError -> Text
- data LoadTomlException = LoadTomlException !FilePath !Text

# Documentation

data TomlDecodeError #

Type of exception for converting from TOML to user custom data type.

Since: 1.3.0.0

Constructors

BiMapError !Key !TomlBiMapError |
KeyNotFound !Key | No such key
TableNotFound !Key | No such table
TableArrayNotFound !Key | No such table array Since: 1.3.0.0
ParseError !TomlParseError | Exception during parsing
NotExactDecode !TOML | Unused field left in the decoded TOML. Since: 1.3.2.0

#### Instances

Instances details

NFData TomlDecodeError # |
Instance details Defined in Toml.Codec.Error Methods rnf :: TomlDecodeError -> () #
Generic TomlDecodeError # |
Instance details Defined in Toml.Codec.Error Associated Types
type Rep TomlDecodeError |
Instance details Defined in Toml.Codec.Error type Rep TomlDecodeError = D1 ('MetaData "TomlDecodeError" "Toml.Codec.Error" "tomland-1.3.3.3-EUmut0o3bp2HnXO9U1VNsY" 'False) ((C1 ('MetaCons "BiMapError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TomlBiMapError)) :+: (C1 ('MetaCons "KeyNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key)) :+: C1 ('MetaCons "TableNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key)))) :+: (C1 ('MetaCons "TableArrayNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key)) :+: (C1 ('MetaCons "ParseError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TomlParseError)) :+: C1 ('MetaCons "NotExactDecode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TOML)))))
Methods from :: TomlDecodeError -> Rep TomlDecodeError x # to :: Rep TomlDecodeError x -> TomlDecodeError #
Show TomlDecodeError # |
Instance details Defined in Toml.Codec.Error Methods showsPrec :: Int -> TomlDecodeError -> ShowS # show :: TomlDecodeError -> String # showList :: [TomlDecodeError] -> ShowS #
Eq TomlDecodeError # |
Instance details Defined in Toml.Codec.Error Methods (==) :: TomlDecodeError -> TomlDecodeError -> Bool # (/=) :: TomlDecodeError -> TomlDecodeError -> Bool #
type Rep TomlDecodeError # |
Instance details Defined in Toml.Codec.Error type Rep TomlDecodeError = D1 ('MetaData "TomlDecodeError" "Toml.Codec.Error" "tomland-1.3.3.3-EUmut0o3bp2HnXO9U1VNsY" 'False) ((C1 ('MetaCons "BiMapError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TomlBiMapError)) :+: (C1 ('MetaCons "KeyNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key)) :+: C1 ('MetaCons "TableNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key)))) :+: (C1 ('MetaCons "TableArrayNotFound" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Key)) :+: (C1 ('MetaCons "ParseError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TomlParseError)) :+: C1 ('MetaCons "NotExactDecode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TOML)))))

prettyTomlDecodeErrors :: [TomlDecodeError] -> Text #

Converts `TomlDecodeError`s into pretty human-readable text.

Since: 1.3.0.0

prettyTomlDecodeError :: TomlDecodeError -> Text #

Converts `TomlDecodeError` into pretty human-readable text.

Since: 1.3.0.0

data LoadTomlException #

File loading error data type.

Since: 0.3.1

Constructors

LoadTomlException !FilePath !Text |

#### Instances

Instances details

Exception LoadTomlException # | Since: 0.3.1
Instance details Defined in Toml.Codec.Error Methods toException :: LoadTomlException -> SomeException # fromException :: SomeException -> Maybe LoadTomlException # displayException :: LoadTomlException -> String # backtraceDesired :: LoadTomlException -> Bool #
Show LoadTomlException # | Since: 0.3.1
Instance details Defined in Toml.Codec.Error Methods showsPrec :: Int -> LoadTomlException -> ShowS # show :: LoadTomlException -> String # showList :: [LoadTomlException] -> ShowS #