| Copyright | (c) Moritz Clasmeier 2018 |
|---|---|
| License | BSD3 |
| Maintainer | mtesseract@silverratio.net |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Control.Error.Context.Types
Description
Provides an API for enriching errors with contexts.
- data ErrorContext = ErrorContext {}
- data ErrorWithContext e = ErrorWithContext ErrorContext e
- errorContextAsString :: ErrorContext -> String
- class (Monad m, MonadThrow m) => MonadErrorContext m where
Documentation
data ErrorWithContext e Source #
Boundles an error with an ErrorContext.
Constructors
| ErrorWithContext ErrorContext e |
Instances
| Functor ErrorWithContext Source # | |
| Show e => Show (ErrorWithContext e) Source # | |
| Exception e => Exception (ErrorWithContext e) Source # | An |
class (Monad m, MonadThrow m) => MonadErrorContext m where Source #
Monad type class providing contextualized errors.
Minimal complete definition
Methods
Arguments
| :: m ErrorContext | Return the current error context. |
withErrorContext :: ToJSON v => Text -> v -> m a -> m a Source #
withErrorNamespace :: Text -> m a -> m a Source #
Instances
| MonadCatch m => MonadErrorContext (ErrorContextT m) Source # | |
| (MonadCatch m, KatipContext m) => MonadErrorContext (ErrorContextKatipT m) Source # | |