module Network.HTTP2.Client.Exceptions (
ClientIO
, ClientError(..)
, runClientIO
, module Control.Monad.Except
, module Control.Monad.Trans
) where
import Control.Monad.Trans (lift)
import Control.Exception (Exception)
import Control.Monad.Except (ExceptT, runExceptT, throwError)
type ClientIO = ExceptT ClientError IO
runClientIO :: ClientIO a -> IO (Either ClientError a)
runClientIO :: forall a. ClientIO a -> IO (Either ClientError a)
runClientIO = ExceptT ClientError IO a -> IO (Either ClientError a)
forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a)
runExceptT
data ClientError = EarlyEndOfStream
deriving (Int -> ClientError -> ShowS
[ClientError] -> ShowS
ClientError -> String
(Int -> ClientError -> ShowS)
-> (ClientError -> String)
-> ([ClientError] -> ShowS)
-> Show ClientError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ClientError -> ShowS
showsPrec :: Int -> ClientError -> ShowS
$cshow :: ClientError -> String
show :: ClientError -> String
$cshowList :: [ClientError] -> ShowS
showList :: [ClientError] -> ShowS
Show,Eq ClientError
Eq ClientError =>
(ClientError -> ClientError -> Ordering)
-> (ClientError -> ClientError -> Bool)
-> (ClientError -> ClientError -> Bool)
-> (ClientError -> ClientError -> Bool)
-> (ClientError -> ClientError -> Bool)
-> (ClientError -> ClientError -> ClientError)
-> (ClientError -> ClientError -> ClientError)
-> Ord ClientError
ClientError -> ClientError -> Bool
ClientError -> ClientError -> Ordering
ClientError -> ClientError -> ClientError
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ClientError -> ClientError -> Ordering
compare :: ClientError -> ClientError -> Ordering
$c< :: ClientError -> ClientError -> Bool
< :: ClientError -> ClientError -> Bool
$c<= :: ClientError -> ClientError -> Bool
<= :: ClientError -> ClientError -> Bool
$c> :: ClientError -> ClientError -> Bool
> :: ClientError -> ClientError -> Bool
$c>= :: ClientError -> ClientError -> Bool
>= :: ClientError -> ClientError -> Bool
$cmax :: ClientError -> ClientError -> ClientError
max :: ClientError -> ClientError -> ClientError
$cmin :: ClientError -> ClientError -> ClientError
min :: ClientError -> ClientError -> ClientError
Ord,ClientError -> ClientError -> Bool
(ClientError -> ClientError -> Bool)
-> (ClientError -> ClientError -> Bool) -> Eq ClientError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ClientError -> ClientError -> Bool
== :: ClientError -> ClientError -> Bool
$c/= :: ClientError -> ClientError -> Bool
/= :: ClientError -> ClientError -> Bool
Eq)
instance Exception ClientError