rest-core-0.32.0.2: Rest API library.

Safe HaskellNone
LanguageHaskell98

Rest.Error

Description

Error types that can be returned by handlers, as well as some utilities for manipulating these errors.

Synopsis

Documentation

mapE :: (Applicative m, Monad m) => (e -> e') -> ErrorT e m a -> ErrorT e' m a infixl 8 Source

orThrow :: MonadError e m => m (Maybe b) -> e -> m b Source

orThrowWith :: MonadError a m => m (Either e b) -> (e -> a) -> m b Source

domainReason :: (a -> Int) -> a -> Reason a Source

Wrap your custom error type in a Reason. The first argument is a function for converting your error to an HTTP status code.