1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

Define throwBaseError

This commit is contained in:
Rick Winfrey 2018-08-07 16:42:28 -07:00
parent 599da68e5c
commit edbc7820e4

View File

@ -36,3 +36,14 @@ instance (Eq1 exc) => Eq1 (BaseError exc) where
instance Show1 exc => Show1 (BaseError exc) where
liftShowsPrec sl sp d (BaseError _ exc) = liftShowsPrec sl sp d exc
throwBaseError :: ( Member (Resumable (BaseError exc)) effects
, Member (Reader M.ModuleInfo) effects
, Member (Reader S.Span) effects
)
=> exc resume
-> Evaluator address value effects resume
throwBaseError err = do
moduleInfo <- currentModule
span <- currentSpan
throwResumable $ BaseError moduleInfo span err