lib: show txn's file position in assertion errors

This commit is contained in:
Simon Michael 2016-02-19 22:46:59 -08:00
parent 92d5b0ab3d
commit c9937db10e

View File

@ -494,7 +494,11 @@ checkBalanceAssertion (errs,startbal) ps
(showMixedAmount finalsinglebal) (showMixedAmount finalsinglebal)
(diffplus ++ showMixedAmount diff) (diffplus ++ showMixedAmount diff)
(showPostingLine p) (showPostingLine p)
(maybe "" (("in transaction:\n"++).show) $ ptransaction p) (case ptransaction p of
Nothing -> ""
Just t -> printf "in transaction at %s line %d:\n%s" f l (show t)
where GenericSourcePos f l _ = tsourcepos t
)
-- Given a sequence of postings to a single account, split it into -- Given a sequence of postings to a single account, split it into
-- sub-sequences consisting of ordinary postings followed by a single -- sub-sequences consisting of ordinary postings followed by a single