From 2b672c58375a45e70ae962617f5505567ffbb497 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 8 Apr 2009 03:10:15 +0000 Subject: [PATCH] tweak error message --- Ledger/LedgerTransaction.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Ledger/LedgerTransaction.hs b/Ledger/LedgerTransaction.hs index 0a55a30c9..47e9007bd 100644 --- a/Ledger/LedgerTransaction.hs +++ b/Ledger/LedgerTransaction.hs @@ -91,8 +91,8 @@ isLedgerTransactionBalanced (LedgerTransaction {ltpostings=ps}) = -- return an error message instead. balanceLedgerTransaction :: LedgerTransaction -> Either String LedgerTransaction balanceLedgerTransaction t@LedgerTransaction{ltpostings=ps} - | length missingamounts > 1 = Left $ showerr "could not balance this entry, too many missing amounts" - | not $ isLedgerTransactionBalanced t' = Left $ showerr "could not balance this entry, amounts do not balance" + | length missingamounts > 1 = Left $ printerr "could not balance this entry, too many missing amounts" + | not $ isLedgerTransactionBalanced t' = Left $ printerr "could not balance this entry, amounts do not add up to zero" | otherwise = Right t' where (withamounts, missingamounts) = partition hasAmount $ filter isReal ps @@ -103,4 +103,4 @@ balanceLedgerTransaction t@LedgerTransaction{ltpostings=ps} balance p | isReal p && not (hasAmount p) = p{pamount = costOfMixedAmount (-otherstotal)} | otherwise = p where otherstotal = sum $ map pamount withamounts - showerr s = printf "%s:\n%s" s (showLedgerTransactionUnelided t) + printerr s = printf "%s:\n%s" s (showLedgerTransactionUnelided t)