servant/servant-client/src/Servant/Client/PerformRequest/Base.hs

36 lines
984 B
Haskell
Raw Normal View History

2016-05-12 15:20:15 +02:00
{-# LANGUAGE DeriveDataTypeable #-}
module Servant.Client.PerformRequest.Base where
import Control.Exception
import Data.ByteString.Lazy
import Data.Typeable
import Network.HTTP.Media
import Network.HTTP.Types
data ServantError
= FailureResponse
{ responseStatus :: Status
, responseContentType :: MediaType
, responseBody :: ByteString
}
| DecodeFailure
{ decodeError :: String
, responseContentType :: MediaType
, responseBody :: ByteString
}
| UnsupportedContentType
{ responseContentType :: MediaType
, responseBody :: ByteString
}
| InvalidContentTypeHeader
{ responseContentTypeHeader :: ByteString
, responseBody :: ByteString
}
| ConnectionError
{ connectionError :: SomeException
}
deriving (Show, Typeable)
instance Exception ServantError