Safe Haskell | None |
---|---|
Language | Haskell98 |
Error types that can be returned by handlers, as well as some utilities for manipulating these errors.
- module Rest.Types.Error
- mapE :: (Applicative m, Monad m) => (e -> e') -> ExceptT e m a -> ExceptT e' m a
- orThrow :: MonadError e m => m (Maybe b) -> e -> m b
- orThrowWith :: MonadError a m => m (Either e b) -> (e -> a) -> m b
- eitherToStatus :: Either a b -> Status a b
- domainReason :: a -> Reason a
- (>|<) :: Monad m => ExceptT f m a -> ExceptT e m a -> ExceptT e m a
Documentation
module Rest.Types.Error
orThrow :: MonadError e m => m (Maybe b) -> e -> m b Source #
orThrowWith :: MonadError a m => m (Either e b) -> (e -> a) -> m b Source #
eitherToStatus :: Either a b -> Status a b Source #
domainReason :: a -> Reason a Source #
Wrap your custom error type in a Reason
.