diff --git a/docs/en/pact-functions.md b/docs/en/pact-functions.md index a879dca3c..a1fa73c64 100644 --- a/docs/en/pact-functions.md +++ b/docs/en/pact-functions.md @@ -216,7 +216,7 @@ pact> (drop ['name] { 'name: "Vlad", 'active: false}) Fail transaction with MSG if pure expression TEST is false. Otherwise, returns true. ```lisp pact> (enforce (!= (+ 2 2) 4) "Chaos reigns") -:0:0: Chaos reigns +:0:0:Error: Chaos reigns ``` @@ -1953,7 +1953,7 @@ Set environment gas limit to LIMIT. Enable and obtain gas logging. Bracket around the code whose gas logs you want to inspect. ```lisp pact> (env-gasmodel "table") (env-gaslimit 10) (env-gaslog) (map (+ 1) [1 2 3]) (env-gaslog) -["TOTAL: 7" "map:GUnreduced: 4" "+:GUnreduced: 1" "+:GUnreduced: 1" "+:GUnreduced: 1"] +["TOTAL: 7" "map:GUnreduced:currTotalGas=4: 4" "+:GUnreduced:currTotalGas=5: 1" ":GIntegerOpCost:(1, ):(1, ):currTotalGas=5: 0" "+:GUnreduced:currTotalGas=6: 1" ":GIntegerOpCost:(1, ):(2, ):currTotalGas=6: 0" "+:GUnreduced:currTotalGas=7: 1" ":GIntegerOpCost:(1, ):(3, ):currTotalGas=7: 0"] ``` diff --git a/src-tool/Pact/Analyze/Remote/Server.hs b/src-tool/Pact/Analyze/Remote/Server.hs index 7c57eac14..8cbaefa5e 100644 --- a/src-tool/Pact/Analyze/Remote/Server.hs +++ b/src-tool/Pact/Analyze/Remote/Server.hs @@ -103,6 +103,7 @@ moduleNotFoundP :: MP.Parsec Void String ModuleName moduleNotFoundP = MP.string ":" *> digitsP *> MP.char ':' *> digitsP *> MP.char ':' + *> MP.string "Error" *> MP.char ':' *> MP.string " Module " *> fmap fromString (MP.some $ MP.anySingleBut ' ') <* MP.string " not found" diff --git a/src/Pact/Repl.hs b/src/Pact/Repl.hs index 744df80bd..b5178b85c 100644 --- a/src/Pact/Repl.hs +++ b/src/Pact/Repl.hs @@ -294,8 +294,8 @@ renderErr a let i = case m of Script _ f -> Info (Just (mempty,Parsed (Directed (encodeUtf8 $ pack f) 0 0 0 0) 0)) _ -> Info (Just (mempty,Parsed (Lines 0 0 0 0) 0)) - return $ renderInfo i ++ ": " ++ renderCompactString' (peDoc a) - | otherwise = return $ renderInfo (peInfo a) ++ ": " ++ renderCompactString' (peDoc a) + return $ renderInfo i ++ ":Error: " ++ renderCompactString' (peDoc a) + | otherwise = return $ renderInfo (peInfo a) ++ ":Error: " ++ renderCompactString' (peDoc a) updateForOp :: Info -> Term Name -> Repl (Either String (Term Name)) updateForOp i a = do @@ -388,7 +388,7 @@ execScriptF dolog f stateMod = do fmap sequence $ forM _rlsTests $ \TestResult{..} -> case trFailure of Nothing -> return (Just ()) Just (i,e) -> do - hPutStrLn stderr $ renderInfo (_faInfo i) ++ ": " ++ unpack e + hPutStrLn stderr $ renderInfo (_faInfo i) ++ ":ExecError: " ++ unpack e return Nothing case r of Left _ -> outFailures >> return (Left ()) diff --git a/src/Pact/Repl/Lib.hs b/src/Pact/Repl/Lib.hs index 403255826..e599be49a 100644 --- a/src/Pact/Repl/Lib.hs +++ b/src/Pact/Repl/Lib.hs @@ -534,7 +534,7 @@ testCatch :: FunApp -> Text -> Eval LibState a -> Doc -> (a -> Eval LibState (Term Name)) -> Eval LibState (Term Name) testCatch i doc expr errMsg cont = catchesPactError expr >>= \r -> case r of Right v -> cont v - Left e -> testFailure i doc $ errMsg <> ": " <> prettyErr e + Left e -> testFailure i doc $ errMsg <> ":" <> prettyErr e where prettyErr e = prettyInfo (peInfo e) <> peDoc e prettyInfo a