servant-client-core-0.20.3.0: 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 Source #

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 Source # | 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 -> () Source #
Exception ClientError Source # |
Instance details Defined in Servant.Client.Core.ClientError Methods toException :: ClientError -> SomeException Source # fromException :: SomeException -> Maybe ClientError Source # displayException :: ClientError -> String Source # backtraceDesired :: ClientError -> Bool Source #
Generic ClientError Source # |

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.3.0-8S9QaOrR0pTLkHAcl21Dlv" '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 Source #

to :: Rep ClientError x -> ClientError Source #

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

Instance details

Defined in Servant.Client.Core.ClientError

type Rep ClientError = D1 ('MetaData "ClientError" "Servant.Client.Core.ClientError" "servant-client-core-0.20.3.0-8S9QaOrR0pTLkHAcl21Dlv" '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)))))