servant-client-core-0.20.2: Core functionality and class for client function generation for servant APIs

Safe Haskell | None
Language | Haskell2010

Servant.Client.Core.ClientError

Synopsis

- data ClientError
  - = FailureResponse (RequestF () (BaseUrl, ByteString)) Response
  - | DecodeFailure Text Response
  - | UnsupportedContentType MediaType Response
  - | InvalidContentTypeHeader Response
  - | ConnectionError SomeException

# Documentation

data ClientError #

A type representing possible errors in a request

Note that this type substantially changed in 0.12.

Constructors

FailureResponse (RequestF () (BaseUrl, ByteString)) Response | The server returned an error response including the failing request. `requestPath` includes the `BaseUrl` and the path of the request.
DecodeFailure Text Response | The body could not be decoded at the expected type
UnsupportedContentType MediaType Response | The content-type of the response is not supported
InvalidContentTypeHeader Response | The content-type header is invalid
ConnectionError SomeException | There was a connection error, and no response was received

#### Instances

Instances details

NFData ClientError # | Note: an exception in `ConnectionError` might not be evaluated fully, We only `rnf` its `show`ed value.
Instance details Defined in Servant.Client.Core.ClientError Methods rnf :: ClientError -> () #
Exception ClientError # |
Instance details Defined in Servant.Client.Core.ClientError Methods toException :: ClientError -> SomeException # fromException :: SomeException -> Maybe ClientError # displayException :: ClientError -> String # backtraceDesired :: ClientError -> Bool #
Generic ClientError # |

Instance details

Defined in Servant.Client.Core.ClientError

Associated Types

type Rep ClientError |

Instance details

Defined in Servant.Client.Core.ClientError

type Rep ClientError = D1 ('MetaData "ClientError" "Servant.Client.Core.ClientError" "servant-client-core-0.20.2-JDs2vIfQ3Bk9wqlGzwnuNZ" 'False) ((C1 ('MetaCons "FailureResponse" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (RequestF () (BaseUrl, ByteString))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response)) :+: C1 ('MetaCons "DecodeFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response))) :+: (C1 ('MetaCons "UnsupportedContentType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MediaType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response)) :+: (C1 ('MetaCons "InvalidContentTypeHeader" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response)) :+: C1 ('MetaCons "ConnectionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeException)))))

Methods

from :: ClientError -> Rep ClientError x #

to :: Rep ClientError x -> ClientError #

Show ClientError # |
Instance details Defined in Servant.Client.Core.ClientError Methods showsPrec :: Int -> ClientError -> ShowS # show :: ClientError -> String # showList :: [ClientError] -> ShowS #
Eq ClientError # |
Instance details Defined in Servant.Client.Core.ClientError Methods (==) :: ClientError -> ClientError -> Bool # (/=) :: ClientError -> ClientError -> Bool #
type Rep ClientError # |

Instance details

Defined in Servant.Client.Core.ClientError

type Rep ClientError = D1 ('MetaData "ClientError" "Servant.Client.Core.ClientError" "servant-client-core-0.20.2-JDs2vIfQ3Bk9wqlGzwnuNZ" 'False) ((C1 ('MetaCons "FailureResponse" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (RequestF () (BaseUrl, ByteString))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response)) :+: C1 ('MetaCons "DecodeFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response))) :+: (C1 ('MetaCons "UnsupportedContentType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MediaType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response)) :+: (C1 ('MetaCons "InvalidContentTypeHeader" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Response)) :+: C1 ('MetaCons "ConnectionError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SomeException)))))