Skip to content

Commit

Permalink
SCP-4225 wip on annotation of error
Browse files Browse the repository at this point in the history
  • Loading branch information
ladamesny committed Aug 8, 2022
1 parent bbd1a23 commit 408f837
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions marlowe-cli/src/Language/Marlowe/CLI/Test/Script.hs
Expand Up @@ -169,6 +169,11 @@ interpret Prepare {..} = do

interpret (Fail message) = throwError $ CliError message

anotateCliError :: String -> CliError -> CliError
anotateCliError anotation (CliError msg) = CliError $ annotation <> msg

asPrepareError = annotateError "Prepare: "

withError :: MonadError e m => (e -> e) -> m a -> m a
withError modifyError action = catchError action \e -> do
throwError $ modifyError e
Expand Down

0 comments on commit 408f837

Please sign in to comment.