Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- class HasRequestId m where
- getRequestId :: m RequestId
- data RPCException = RPCException {
- rpceRemote :: !LText
- rpceRequest :: !Request
- rpceCause :: !SomeException
- rpc :: (MonadUnliftIO m, MonadCatch m, MonadHttp m, HasRequestId m) => LText -> (Request -> Request) -> m (Response (Maybe LByteString))
- rpc' :: (MonadUnliftIO m, MonadCatch m, MonadHttp m, HasRequestId m) => LText -> Request -> (Request -> Request) -> m (Response (Maybe LByteString))
- parseResponse :: (Exception e, MonadThrow m, FromJSON a) => (LText -> e) -> Response (Maybe LByteString) -> m a
- rpcExceptionMsg :: RPCException -> Msg -> Msg
Documentation
class HasRequestId m where Source #
getRequestId :: m RequestId Source #
data RPCException Source #
RPCException | |
|
Instances
Exception RPCException Source # | |
Defined in Bilge.RPC | |
Show RPCException Source # | |
Defined in Bilge.RPC showsPrec :: Int -> RPCException -> ShowS # show :: RPCException -> String # showList :: [RPCException] -> ShowS # |
rpc :: (MonadUnliftIO m, MonadCatch m, MonadHttp m, HasRequestId m) => LText -> (Request -> Request) -> m (Response (Maybe LByteString)) Source #
:: (MonadUnliftIO m, MonadCatch m, MonadHttp m, HasRequestId m) | |
=> LText | A label for the remote system in case of |
-> Request | |
-> (Request -> Request) | |
-> m (Response (Maybe LByteString)) |
Perform an HTTP request and return the response, thereby
forwarding the Request-Id
header from the current monadic
context.
Note: syncIO
is wrapped around the IO action performing the request
and any exceptions caught are re-thrown in an RPCException
.
parseResponse :: (Exception e, MonadThrow m, FromJSON a) => (LText -> e) -> Response (Maybe LByteString) -> m a Source #
rpcExceptionMsg :: RPCException -> Msg -> Msg Source #