From 11a5809c5c89049118719df9e06171fedb100b00 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 18 Oct 2018 16:02:06 -0400 Subject: [PATCH] journal: improve unassignable error. --- hledger-lib/Hledger/Data/Journal.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index f31c9a02a..e6b776fc9 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -705,7 +705,13 @@ checkUnassignablePosting :: Posting -> CurrentBalancesModifier s () checkUnassignablePosting p = do unassignable <- R.asks eUnassignable if (isAssignment p && paccount p `S.member` unassignable) - then throwError $ "Can't assign to account: " ++ (T.unpack $ paccount p) + then throwError $ unlines $ + [ "cannot assign amount to account " + , "" + , " " ++ (T.unpack $ paccount p) + , "" + , "because it is also included in transaction modifiers." + ] else return ()