Fix CSV parsing to log errors when trying to continue.

The error handling was good enough to continue parsing the CSV data
after a recoverable parser error, but not good enough to actually report
its misfortunes to the user.

See #250 for a report where this is misleading.
This commit is contained in:
Dimitri Fontaine 2015-06-25 10:30:56 +02:00
parent b55ded11e0
commit 250ed1c791

View File

@ -147,7 +147,10 @@
:target (target csv)
:process-row-fn process-row-fn)))
(handler-case
(handler-bind ((cl-csv:csv-parse-error #'cl-csv::continue))
(handler-bind ((cl-csv:csv-parse-error
#'(lambda (c)
(log-message :error "~a" c)
(cl-csv::continue))))
(cl-csv:read-csv input
:row-fn (compile nil reformat-then-process)
:separator (csv-separator csv)