From 250ed1c7918c26c748da894d499bcc3a8b2f3b29 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 25 Jun 2015 10:30:56 +0200 Subject: [PATCH] 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. --- src/sources/csv/csv.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sources/csv/csv.lisp b/src/sources/csv/csv.lisp index 8ad9c77..15f459b 100644 --- a/src/sources/csv/csv.lisp +++ b/src/sources/csv/csv.lisp @@ -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)