diff --git a/hledger-lib/Hledger/Data/Timeclock.hs b/hledger-lib/Hledger/Data/Timeclock.hs index e4a356dda..3593241a7 100644 --- a/hledger-lib/Hledger/Data/Timeclock.hs +++ b/hledger-lib/Hledger/Data/Timeclock.hs @@ -112,9 +112,14 @@ pairClockEntries (entry : rest) actives sessions inentries = case filter ((== tlaccount entry) . tlaccount) actives of [] -> entry : actives activesinthisacct -> error' $ T.unpack $ makeTimeClockErrorExcerpt entry $ T.unlines $ [ - "Simultaneous sessions with the same account name are not supported." - ,"This clockin overlaps with:" - ] <> map (flip makeTimeClockErrorExcerpt "") activesinthisacct + "" + ,"overlaps with session beginning at:" + ,"" + ] + <> map (flip makeTimeClockErrorExcerpt "") activesinthisacct + <> [ + "Overlapping sessions with the same account name are not supported." + ] -- XXX better to show full session(s) -- <> map T.show (filter ((`elem` activesinthisacct).in') sessions) @@ -123,7 +128,6 @@ makeTimeClockErrorExcerpt e@TimeclockEntry{tlsourcepos=pos} msg = T.unlines [ T.pack (sourcePosPretty pos) <> ":" ,l <> " | " <> T.show e -- ,T.replicate (T.length l) " " <> " |" -- <> T.replicate c " " <> "^") - ,"" ] <> msg where l = T.show $ unPos $ sourceLine $ tlsourcepos e diff --git a/hledger/test/errors/tcorderedactions.test b/hledger/test/errors/tcorderedactions.test index e79648341..76243347e 100644 --- a/hledger/test/errors/tcorderedactions.test +++ b/hledger/test/errors/tcorderedactions.test @@ -2,8 +2,12 @@ $$$ hledger check -f tcorderedactions.timeclock >>>2 /Error: .*tcorderedactions.timeclock:8:1: 8 \| i 2022-01-01 00:01:00 a -Simultaneous sessions with the same account name are not supported. -This clockin overlaps with: +overlaps with session beginning at: + +.* +7 \| i 2022-01-01 00:00:00 a + +Overlapping sessions with the same account name are not supported. / >>>= 1 diff --git a/hledger/test/timeclock.test b/hledger/test/timeclock.test index 7a872eb8d..eb458b0e2 100644 --- a/hledger/test/timeclock.test +++ b/hledger/test/timeclock.test @@ -200,7 +200,7 @@ i 2024-01-01 14:00:00 a o 2024-01-01 15:00:00 $ hledger -f timeclock:- print ->2 /Simultaneous sessions with the same account name are not supported./ +>2 /Overlapping sessions with the same account name are not supported./ >=!0 # ** OLD: