error-context-0.2.0.0: Provides API for enriching errors with contexts

Safe HaskellNone
LanguageHaskell2010

Control.Error.Context.Exception

Synopsis

Documentation

catchWithContext :: (MonadCatch m, Exception e) => m a -> (ErrorWithContext e -> m a) -> m a Source #

Like catch, but the handler is required to be context-aware. Is also able to catch exceptions of type e (without context).

catchWithoutContext :: forall a e m. (MonadCatch m, Exception e) => m a -> (e -> m a) -> m a Source #

Like catch, but the handler is required to be context-unaware. Is also able to catch exceptions with context, in which case the context will be forgotten before the exception will be provided to the handler.

tryWithoutContext :: (MonadCatch m, Exception e) => m a -> m (Either e a) Source #

errorContextForget :: ErrorWithContext e -> e Source #

Forgets the context from an enriched error.

catchAnyWithContext :: MonadCatch m => m a -> (ErrorWithContext SomeException -> m a) -> m a Source #

Context aware version of catchAny.

catchAnyWithoutContext :: MonadCatch m => m a -> (SomeException -> m a) -> m a Source #

Context aware version of catchAny.