Remove catchServantError
This commit is contained in:
parent
80188e024e
commit
454f53315f
3 changed files with 1 additions and 8 deletions
|
@ -25,12 +25,11 @@ import Servant.Client.Core.Internal.Request (Request, Response, GenRes
|
||||||
ServantError (..))
|
ServantError (..))
|
||||||
import Servant.Client.Core.Internal.ClientF
|
import Servant.Client.Core.Internal.ClientF
|
||||||
|
|
||||||
class (Monad m) => RunClient m where
|
class Monad m => RunClient m where
|
||||||
-- | How to make a request.
|
-- | How to make a request.
|
||||||
runRequest :: Request -> m Response
|
runRequest :: Request -> m Response
|
||||||
streamingRequest :: Request -> m StreamingResponse
|
streamingRequest :: Request -> m StreamingResponse
|
||||||
throwServantError :: ServantError -> m a
|
throwServantError :: ServantError -> m a
|
||||||
catchServantError :: m a -> (ServantError -> m a) -> m a
|
|
||||||
|
|
||||||
checkContentTypeHeader :: RunClient m => Response -> m MediaType
|
checkContentTypeHeader :: RunClient m => Response -> m MediaType
|
||||||
checkContentTypeHeader response =
|
checkContentTypeHeader response =
|
||||||
|
@ -56,7 +55,3 @@ instance ClientF ~ f => RunClient (Free f) where
|
||||||
runRequest req = liftF (RunRequest req id)
|
runRequest req = liftF (RunRequest req id)
|
||||||
streamingRequest req = liftF (StreamingRequest req id)
|
streamingRequest req = liftF (StreamingRequest req id)
|
||||||
throwServantError = liftF . Throw
|
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)
|
|
||||||
|
|
|
@ -78,7 +78,6 @@ instance Alt ClientM where
|
||||||
instance RunClient ClientM where
|
instance RunClient ClientM where
|
||||||
runRequest = performRequest
|
runRequest = performRequest
|
||||||
throwServantError = throwError
|
throwServantError = throwError
|
||||||
catchServantError = catchError
|
|
||||||
|
|
||||||
instance ClientLike (ClientM a) (ClientM a) where
|
instance ClientLike (ClientM a) (ClientM a) where
|
||||||
mkClient = id
|
mkClient = id
|
||||||
|
|
|
@ -96,7 +96,6 @@ instance RunClient ClientM where
|
||||||
runRequest = performRequest
|
runRequest = performRequest
|
||||||
streamingRequest = performStreamingRequest
|
streamingRequest = performStreamingRequest
|
||||||
throwServantError = throwError
|
throwServantError = throwError
|
||||||
catchServantError = catchError
|
|
||||||
|
|
||||||
instance ClientLike (ClientM a) (ClientM a) where
|
instance ClientLike (ClientM a) (ClientM a) where
|
||||||
mkClient = id
|
mkClient = id
|
||||||
|
|
Loading…
Reference in a new issue