@@ -48,7 +48,7 @@ import Web.HttpApiData
4848
4949data ServantError
5050 = FailureResponse
51− { failingRequest :: Request
51+ { failingRequest :: UrlReq
5252 , responseStatus :: Status
5353 , responseContentType :: MediaType
5454 , responseBody :: ByteString
@@ -86,6 +86,11 @@ instance Eq ServantError where
8686
8787instance Exception ServantError
8888
89+data UrlReq = UrlReq BaseUrl Req
90+
91+instance Show UrlReq where
92+ show (UrlReq url req) = showBaseUrl url ++ reqPath req ++ "?" ++ show (qs req)
93+
8994data Req = Req
9095 { reqPath :: String
9196 , qs :: QueryText
@@ -251,7 +256,7 @@ performRequest reqMethod req = do
251256 Nothing -> throwError $ InvalidContentTypeHeader (cs t) body
252257 Just t' -> pure t'
253258 unless (status_code >= 200 && status_code < 300) $
254− throwError $ FailureResponse request status ct body
259+ throwError $ FailureResponse (UrlReq reqHost req) status ct body
255260 return (status_code, body, ct, hdrs, response)
256261
257262performRequestCT :: MimeUnrender ct result => Proxy ct -> Method -> Req