From 372a6c7753e7aedd3a089b0913e3c2dc57a791f4 Mon Sep 17 00:00:00 2001 From: Nickolay Kudasov Date: Wed, 20 Jan 2016 02:46:08 +0300 Subject: [PATCH] Update servant-client --- servant-client/src/Servant/Common/Req.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/servant-client/src/Servant/Common/Req.hs b/servant-client/src/Servant/Common/Req.hs index ea610cce..65535ebb 100644 --- a/servant-client/src/Servant/Common/Req.hs +++ b/servant-client/src/Servant/Common/Req.hs @@ -186,7 +186,8 @@ performRequestCT ct reqMethod req manager reqHost = do (_status, respBody, respCT, hdrs, _response) <- performRequest reqMethod (req { reqAccept = [acceptCT] }) manager reqHost unless (matches respCT (acceptCT)) $ throwE $ UnsupportedContentType respCT respBody - case mimeUnrender ct respBody of + unrenderResult <- liftIO . runExceptT $ mimeUnrender ct respBody + case unrenderResult of Left err -> throwE $ DecodeFailure err respCT respBody Right val -> return (hdrs, val)