From 180f4baedbcc682d4eb5d819b34d2b24644cbd79 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 14 Sep 2019 02:39:59 -0700 Subject: [PATCH] ;lib: csv: note cause of #1087 [ci skip] --- hledger-lib/Hledger/Read.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hledger-lib/Hledger/Read.hs b/hledger-lib/Hledger/Read.hs index 43931e9a5..bccbd1ae4 100644 --- a/hledger-lib/Hledger/Read.hs +++ b/hledger-lib/Hledger/Read.hs @@ -307,6 +307,8 @@ readJournal iopts mfile txt = tryReaders :: InputOpts -> Maybe FilePath -> [Reader] -> Text -> IO (Either String Journal) tryReaders iopts mpath readers txt = firstSuccessOrFirstError [] readers where + -- TODO: #1087 when parsing csv with -f -, if the csv (rules) parser fails, + -- we would rather see that error, not the one from the journal parser firstSuccessOrFirstError :: [String] -> [Reader] -> IO (Either String Journal) firstSuccessOrFirstError [] [] = return $ Left "no readers found" firstSuccessOrFirstError errs (r:rs) = do