From b149c0ba0c258b67605c3978d887a108a7b9a7bd Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 16 Apr 2020 12:59:19 -0700 Subject: [PATCH] ;csv: tweak the too-many-amounts error more --- hledger-lib/Hledger/Read/CsvReader.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hledger-lib/Hledger/Read/CsvReader.hs b/hledger-lib/Hledger/Read/CsvReader.hs index 9e2df62e4..2248603a7 100644 --- a/hledger-lib/Hledger/Read/CsvReader.hs +++ b/hledger-lib/Hledger/Read/CsvReader.hs @@ -899,13 +899,14 @@ getAmount rules record currency p1IsVirtual n = [(f,a)] | "-out" `isSuffixOf` f -> Just (-a) -- for -out fields, flip the sign [(_,a)] -> Just a fs -> error' $ unlines $ [ - "more than one non-zero amount for this record, or multiple zeros" - ,"- please ensure just one. (https://hledger.org/csv.html#amount)" + "multiple non-zero amounts or multiple zero amounts assigned," + ,"please ensure just one. (https://hledger.org/csv.html#amount)" ," " ++ showRecord record + ," for posting: " ++ show n ] - ++ [" rule: " ++ f ++ " " ++ + ++ [" assignment: " ++ f ++ " " ++ fromMaybe "" (hledgerField rules record f) ++ - " amount parsed: " ++ showMixedAmount a -- XXX not sure this is showing all the right info + "\t=> value: " ++ showMixedAmount a -- XXX not sure this is showing all the right info | (f,a) <- fs] where