capnp-0.11.0.0: Cap'n Proto for Haskell
Safe HaskellNone
LanguageHaskell2010

Capnp.Rpc.Errors

Description

In addition to the values exposed in the API, this module also defines an instance of Haskell's Exception type class, for Cap'n Proto's Exception.

Synopsis

Converting arbitrary exceptions to capnproto exceptions

wrapException :: Bool -> SomeException -> Exception Source #

wrapException debugMode e converts an arbitrary haskell exception e into an rpc exception, which can be communicated to a remote vat. If debugMode is true, the returned exception's reason field will include the text of show e.

Helpers for constructing exceptions

eMethodUnimplemented :: Exception Source #

An exception indicating an unimplemented method.

eUnimplemented :: Text -> Exception Source #

An unimplemented exception with a custom reason message.

eDisconnected :: Exception Source #

An exception with type = disconnected

eFailed :: Text -> Exception Source #

Construct an exception with a type field of failed and the given text as its reason.

throwFailed :: MonadThrow m => Text -> m a Source #

Throw an exception with a type field of Exception'Type'failed and the argument as a reason.

Orphan instances