@@ -48,7 +48,8 @@ import Web.HttpApiData
49data ServantError
49data ServantError
50 = FailureResponse
50 = FailureResponse
51+ { failingRequest :: Request
51− { responseStatus :: Status
52+ , responseStatus :: Status
52 , responseContentType :: MediaType
53 , responseContentType :: MediaType
53 , responseBody :: ByteString
54 , responseBody :: ByteString
@@ -71,8 +72,8 @@ data ServantError
71 deriving (Show, Typeable)
72 deriving (Show, Typeable)
73instance Eq ServantError where
74instance Eq ServantError where
74− FailureResponse a b c == FailureResponse x y z =
75+ FailureResponse a b c d == FailureResponse w x y z =
75− (a, b, c) == (x, y, z)
76+ (show a, b, c, d) == (show w, x, y, z)
76 DecodeFailure a b c == DecodeFailure x y z =
77 DecodeFailure a b c == DecodeFailure x y z =
77 (a, b, c) == (x, y, z)
78 (a, b, c) == (x, y, z)
78 UnsupportedContentType a b == UnsupportedContentType x y =
79 UnsupportedContentType a b == UnsupportedContentType x y =
@@ -224,7 +225,7 @@ runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)
224runClientM cm env = runExceptT $ (flip runReaderT env) $ runClientM' cm
225runClientM cm env = runExceptT $ (flip runReaderT env) $ runClientM' cm
227−performRequest :: Method -> Req
228+performRequest :: Method -> Req
228 -> ClientM ( Int, ByteString, MediaType
229 -> ClientM ( Int, ByteString, MediaType
229 , [HTTP.Header], Response ByteString)
230 , [HTTP.Header], Response ByteString)
230performRequest reqMethod req = do
231performRequest reqMethod req = do
@@ -250,10 +251,10 @@ performRequest reqMethod req = do
250 Nothing -> throwError $ InvalidContentTypeHeader (cs t) body
251 Nothing -> throwError $ InvalidContentTypeHeader (cs t) body
251 Just t' -> pure t'
252 Just t' -> pure t'
252 unless (status_code >= 200 && status_code < 300) $
253 unless (status_code >= 200 && status_code < 300) $
253− throwError $ FailureResponse status ct body
254+ throwError $ FailureResponse request status ct body
254 return (status_code, body, ct, hdrs, response)
255 return (status_code, body, ct, hdrs, response)
256−performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req
257+performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req
257 -> ClientM ([HTTP.Header], result)
258 -> ClientM ([HTTP.Header], result)
258performRequestCT ct reqMethod req = do
259performRequestCT ct reqMethod req = do
259 let acceptCTS = contentTypes ct
260 let acceptCTS = contentTypes ct