diff --git a/marlowe-cli/src/Language/Marlowe/CLI/Test/Script.hs b/marlowe-cli/src/Language/Marlowe/CLI/Test/Script.hs index 4c79b7762d..634378ace4 100644 --- a/marlowe-cli/src/Language/Marlowe/CLI/Test/Script.hs +++ b/marlowe-cli/src/Language/Marlowe/CLI/Test/Script.hs @@ -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