Remove catchServantError

This commit is contained in:
Oleg Grenrus 2018-03-11 16:50:14 +02:00
parent 80188e024e
commit 454f53315f
3 changed files with 1 additions and 8 deletions

View file

@ -25,12 +25,11 @@ import Servant.Client.Core.Internal.Request (Request, Response, GenRes
ServantError (..))
import Servant.Client.Core.Internal.ClientF
class (Monad m) => RunClient m where
class Monad m => RunClient m where
-- | How to make a request.
runRequest :: Request -> m Response
streamingRequest :: Request -> m StreamingResponse
throwServantError :: ServantError -> m a
catchServantError :: m a -> (ServantError -> m a) -> m a
checkContentTypeHeader :: RunClient m => Response -> m MediaType
checkContentTypeHeader response =
@ -56,7 +55,3 @@ instance ClientF ~ f => RunClient (Free f) where
runRequest req = liftF (RunRequest req id)
streamingRequest req = liftF (StreamingRequest req id)
throwServantError = liftF . Throw
catchServantError x h = go x where
go (Pure a) = Pure a
go (Free (Throw e)) = h e
go (Free f) = Free (fmap go f)

View file

@ -78,7 +78,6 @@ instance Alt ClientM where
instance RunClient ClientM where
runRequest = performRequest
throwServantError = throwError
catchServantError = catchError
instance ClientLike (ClientM a) (ClientM a) where
mkClient = id

View file

@ -96,7 +96,6 @@ instance RunClient ClientM where
runRequest = performRequest
streamingRequest = performStreamingRequest
throwServantError = throwError
catchServantError = catchError
instance ClientLike (ClientM a) (ClientM a) where
mkClient = id