Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.CLI.Compatible.Exception
Synopsis
- type CIO e a = HasCallStack => RIO e a
- data CustomCliException where
- CustomCliException :: forall err. (HasCallStack, Show err, Typeable err, Error err) => err -> CustomCliException
- throwCliError :: (HasCallStack, Show e, Typeable e, Error e, MonadIO m) => e -> m a
- fromEitherCli :: forall e m a. (HasCallStack, MonadIO m, Show e, Typeable e, Error e) => Either e a -> m a
- fromEitherIOCli :: forall e m a. (HasCallStack, MonadIO m, Show e, Typeable e, Error e) => IO (Either e a) -> m a
- fromExceptTCli :: forall e m a. (HasCallStack, MonadIO m, Show e, Typeable e, Error e) => ExceptT e IO a -> m a
Documentation
type CIO e a = HasCallStack => RIO e a Source #
Type alias that enforces the presence of a call stack.
data CustomCliException where Source #
Custom exception type for CLI commands. Any custom errors created in `cardano-cl` should be wrapped in this exception type.
Constructors
CustomCliException :: forall err. (HasCallStack, Show err, Typeable err, Error err) => err -> CustomCliException |
Instances
Exception CustomCliException Source # | |
Defined in Cardano.CLI.Compatible.Exception Methods toException :: CustomCliException -> SomeException Source # fromException :: SomeException -> Maybe CustomCliException Source # | |
Show CustomCliException Source # | |
Defined in Cardano.CLI.Compatible.Exception |
throwCliError :: (HasCallStack, Show e, Typeable e, Error e, MonadIO m) => e -> m a Source #
Wrapper function which allows throwing of types of instance Error
, attaching call stack
from the call site
fromEitherCli :: forall e m a. (HasCallStack, MonadIO m, Show e, Typeable e, Error e) => Either e a -> m a Source #
fromEitherIOCli :: forall e m a. (HasCallStack, MonadIO m, Show e, Typeable e, Error e) => IO (Either e a) -> m a Source #
fromExceptTCli :: forall e m a. (HasCallStack, MonadIO m, Show e, Typeable e, Error e) => ExceptT e IO a -> m a Source #