X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fconditions.lisp;h=81a1226bfe48b02a2fbf1456f4bf3ed210303726;hb=e02d79979cb676b5e8d96b16456922afe77f4f74;hp=f6f7e7f0364c165a926b229adf629529ba9e5a07;hpb=2c14c425a4a203e03b74b868fdf727ea0d48572a;p=clsql.git diff --git a/base/conditions.lisp b/base/conditions.lisp index f6f7e7f..81a1226 100644 --- a/base/conditions.lisp +++ b/base/conditions.lisp @@ -36,6 +36,12 @@ (define-condition clsql-simple-warning (simple-condition clsql-warning) ()) +(define-condition clsql-generic-error (clsql-error) + ((message :initarg :message + :reader clsql-generic-error-message)) + (:report (lambda (c stream) + (format stream (clsql-generic-error-message c))))) + (define-condition clsql-invalid-spec-error (clsql-error) ((connection-spec :initarg :connection-spec :reader clsql-invalid-spec-error-connection-spec) @@ -151,6 +157,16 @@ and signal an clsql-invalid-spec-error if they don't match." (format stream "~S is not a CLSQL database." (clsql-no-database-error-database c))))) +(define-condition clsql-odbc-error (clsql-error) + ((odbc-message :initarg :odbc-message + :reader clsql-odbc-error-message) + (sql-state :initarg :sql-state :initform nil + :reader clsql-odbc-error-sql-state)) + (:report (lambda (c stream) + (format stream "[ODBC error] ~A; state: ~A" + (clsql-odbc-error-message c) + (clsql-odbc-error-sql-state c))))) + ;; Signal conditions