X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fconditions.lisp;h=5e805e172e11cc3464eafe0e261e92094cafec86;hp=72c4d31d1a98eb4a873c23c4b3f6db78c874bf79;hb=78489032c6f66ce666ffe5e2e726503b61b94616;hpb=749215ad8b022f7e2d533f5f82097d2d131eefd6 diff --git a/sql/conditions.lisp b/sql/conditions.lisp index 72c4d31..5e805e1 100644 --- a/sql/conditions.lisp +++ b/sql/conditions.lisp @@ -17,15 +17,16 @@ (in-package #:clsql-sys) (defvar *backend-warning-behavior* :warn - "Action to perform on warning messages from backend. Default is to :warn. May also be -set to :error to signal an error or :ignore/nil to silently ignore the warning.") + "Action to perform on warning messages from backend. Default is +to :warn. May also be set to :error to signal an error +or :ignore/nil to silently ignore the warning.") ;;; CommonSQL-compatible conditions (define-condition sql-condition () ()) -(define-condition sql-error (simple-error) +(define-condition sql-error (simple-error sql-condition) ()) (define-condition sql-database-error (sql-error) @@ -42,10 +43,8 @@ set to :error to signal an error or :ignore/nil to silently ignore the warning." :initform nil :reader sql-error-database)) (:report (lambda (c stream) - (format stream "A database error occurred~A: ~A / ~A~% ~A" - (if (sql-error-database c) - (format nil " on database ~A" (sql-error-database c)) - "") + (format stream "A database error occurred~@[ on database ~A~]: ~A / ~A~% ~A" + (sql-error-database c) (sql-error-error-id c) (sql-error-secondary-error-id c) (sql-error-database-message c))))