Copyright | (c) Aleksey Makarov 2021 |
---|---|
License | BSD 3-Clause License |
Maintainer | aleksey.makarov@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Exception that keeps the stack of error locations.
Synopsis
- data ChainedExceptionNext
- data ChainedException = ChainedException {}
- chainedError :: Q Exp
- chainedError' :: Q Exp
- addContext :: Q Exp
- addContext' :: Q Exp
- maybeAddContext :: Q Exp
- maybeAddContext' :: Q Exp
- eitherAddContext' :: Q Exp
Documentation
data ChainedExceptionNext Source #
Structure to organize the stack of exceptions with locations
Null | exception was initiated by |
Next SomeException | some context was added to |
NextChained ChainedException | some context was added to a |
data ChainedException Source #
Exception that keeps track of error locations
Instances
Exception ChainedException Source # | |
Show ChainedException Source # | |
Defined in Control.Exception.ChainedException showsPrec :: Int -> ChainedException -> ShowS # show :: ChainedException -> String # showList :: [ChainedException] -> ShowS # |
chainedError :: Q Exp Source #
$chainedError
results in a function of type
'chainedError :: MonadThrow m => String -> m a
'.
It throws ChainedException
with its argument as error description.
chainedError' :: Q Exp Source #
$chainedError'
is the same as $
chainedError
""
addContext :: Q Exp Source #
$addContext
results in a function of type
'addContext :: MonadCatch m => String -> m a -> m a
'.
It runs the second argument and adds ChainedException
with its first argument
to the exceptions thrown from that monad.
addContext' :: Q Exp Source #
$addContext'
is the same as $addContext ""
maybeAddContext :: Q Exp Source #
$maybeAddContext
results in a function of type
'maybeAddContext :: MonadThrow m => String -> Maybe a -> m a
'.
If its second argument is Nothing
, it throws ChainedException
with its first argument,
else it returns the value of Just
.
maybeAddContext' :: Q Exp Source #
$maybeAddContext'
is the same as $maybeAddContext ""
eitherAddContext' :: Q Exp Source #
$eitherAddContext'
results in a function of type
'eitherAddContext' :: MonadThrow m => Either String a -> m a
'.
If its argument is
, it throws Left
eChainedException
with e
as error description,
else it returns the value of Right
.