From 0cba5edacd57c302bc80376037158cb42d9f62d2 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Mon, 16 Jun 2014 17:31:41 +0200 Subject: [PATCH] Handle the whole of PostgreSQL errors. In a recent test case about camelCasing column names, another kind of error did pop up and there's really no point not to handle it correctly. --- src/pgsql/pgsql.lisp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pgsql/pgsql.lisp b/src/pgsql/pgsql.lisp index cbf0bec..97ead06 100644 --- a/src/pgsql/pgsql.lisp +++ b/src/pgsql/pgsql.lisp @@ -29,9 +29,7 @@ ;; If PostgreSQL signals a data error, process the batch by isolating ;; erroneous data away and retrying the rest. - ((or - CL-POSTGRES-ERROR:INTEGRITY-VIOLATION - CL-POSTGRES-ERROR:DATA-EXCEPTION) (condition) + (cl-postgres-error::database-error (condition) (retry-batch table-name columns batch batch-rows condition)))) ;;; @@ -196,10 +194,7 @@ (incf current-batch-pos current-batch-rows)))) ;; the batch didn't make it, prepare error handling for next turn - ((or - CL-POSTGRES-ERROR:INTEGRITY-VIOLATION - CL-POSTGRES-ERROR:DATA-EXCEPTION) - (next-error-in-batch) + (cl-postgres-error::database-error (next-error-in-batch) (setf condition next-error-in-batch