Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Errors for messagepack decoding.
Synopsis
- data FieldError
- data DecodeError = DecodeError {
- mainType :: Text
- fieldError :: FieldError
- renderError :: DecodeError -> Text
- toDecodeError :: forall a. Typeable a => Either FieldError a -> Either DecodeError a
- decodeError :: forall a. Typeable a => Text -> Either DecodeError a
- incompatible :: forall a. Typeable a => Object -> Either FieldError a
- decodeIncompatible :: forall a. Typeable a => Object -> Either DecodeError a
Documentation
data FieldError Source #
A decoding error in a field of a larger type.
May be nested arbitrarily deep.
Instances
data DecodeError Source #
A messagepack decoding error.
DecodeError | |
|
Instances
renderError :: DecodeError -> Text Source #
Create a user-friendly message for a DecodeError
.
toDecodeError :: forall a. Typeable a => Either FieldError a -> Either DecodeError a Source #
Convert a FieldError
in a Left
to a DecodeError
by adding the type name via Typeable
.
decodeError :: forall a. Typeable a => Text -> Either DecodeError a Source #
Create a
from a Left
DecodeError
Text
by adding the type name via Typeable
.
incompatible :: forall a. Typeable a => Object -> Either FieldError a Source #
Create a FieldError
for a field when the Object
constructor is wrong, using Typeable
to obtain the type name.
decodeIncompatible :: forall a. Typeable a => Object -> Either DecodeError a Source #
Create a DecodeError
for a type when the Object
constructor is wrong, using Typeable
to obtain the type name.