@@ -48,7 +48,8 @@ import Web.HttpApiData
4848
4949data ServantError
5050 = FailureResponse
51− { responseStatus :: Status
51+ { failingRequest :: Request
52+ , responseStatus :: Status
5253 , responseContentType :: MediaType
5354 , responseBody :: ByteString
5455 }
@@ -71,8 +72,8 @@ data ServantError
7172 deriving (Show, Typeable)
7273
7374instance Eq ServantError where
74− FailureResponse a b c == FailureResponse x y z =
75− (a, b, c) == (x, y, z)
75+ FailureResponse a b c d == FailureResponse w x y z =
76+ (show a, b, c, d) == (show w, x, y, z)
7677 DecodeFailure a b c == DecodeFailure x y z =
7778 (a, b, c) == (x, y, z)
7879 UnsupportedContentType a b == UnsupportedContentType x y =
@@ -224,7 +225,7 @@ runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)
224225runClientM cm env = runExceptT $ (flip runReaderT env) $ runClientM' cm
225226
226227
227−performRequest :: Method -> Req
228+performRequest :: Method -> Req
228229 -> ClientM ( Int, ByteString, MediaType
229230 , [HTTP.Header], Response ByteString)
230231performRequest reqMethod req = do
@@ -250,10 +251,10 @@ performRequest reqMethod req = do
250251 Nothing -> throwError $ InvalidContentTypeHeader (cs t) body
251252 Just t' -> pure t'
252253 unless (status_code >= 200 && status_code < 300) $
253− throwError $ FailureResponse status ct body
254+ throwError $ FailureResponse request status ct body
254255 return (status_code, body, ct, hdrs, response)
255256
256−performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req
257+performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req
257258 -> ClientM ([HTTP.Header], result)
258259performRequestCT ct reqMethod req = do
259260 let acceptCTS = contentTypes ct