r11859: Canonicalize whitespace
[clsql.git] / sql / conditions.lisp
index 5e805e172e11cc3464eafe0e261e92094cafec86..549f8f869f7a8e155b47d0739851bdf545364e81 100644 (file)
@@ -22,7 +22,7 @@ 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 ()
   ())
 
@@ -30,52 +30,52 @@ or :ignore/nil to silently ignore the warning.")
   ())
 
 (define-condition sql-database-error (sql-error)
-  ((error-id :initarg :error-id 
-            :initform nil
-            :reader sql-error-error-id)
+  ((error-id :initarg :error-id
+             :initform nil
+             :reader sql-error-error-id)
    (secondary-error-id :initarg :secondary-error-id
-                      :initform nil
-                      :reader sql-error-secondary-error-id)
+                       :initform nil
+                       :reader sql-error-secondary-error-id)
    (database-message :initarg :message
-                    :initform nil
-                    :reader sql-error-database-message)
+                     :initform nil
+                     :reader sql-error-database-message)
    (database :initarg :database
-                    :initform nil
-                    :reader sql-error-database))
+                     :initform nil
+                     :reader sql-error-database))
   (:report (lambda (c stream)
-            (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))))
+             (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))))
   (:documentation "Used to signal an error in a CLSQL database interface."))
 
 (define-condition sql-connection-error (sql-database-error)
   ((database-type :initarg :database-type :initform nil
-                 :reader sql-error-database-type)
+                  :reader sql-error-database-type)
    (connection-spec :initarg :connection-spec :initform nil
-                 :reader sql-error-connection-spec))
+                  :reader sql-error-connection-spec))
   (:report (lambda (c stream)
-            (format stream "While trying to connect to database ~A~%  using database-type ~A:~%  Error ~D / ~A~%  has occurred."
-                    (when (and (sql-error-connection-spec c)
-                               (sql-error-database-type c))
-                      (database-name-from-spec
-                       (sql-error-connection-spec c)
-                       (sql-error-database-type c)))
-                    (sql-error-database-type c)
-                    (sql-error-error-id c)
-                    (sql-error-database-message c))))
+             (format stream "While trying to connect to database ~A~%  using database-type ~A:~%  Error ~D / ~A~%  has occurred."
+                     (when (and (sql-error-connection-spec c)
+                                (sql-error-database-type c))
+                       (database-name-from-spec
+                        (sql-error-connection-spec c)
+                        (sql-error-database-type c)))
+                     (sql-error-database-type c)
+                     (sql-error-error-id c)
+                     (sql-error-database-message c))))
   (:documentation "Used to signal an error in connecting to a database."))
 
 (define-condition sql-database-data-error (sql-database-error)
-  ((expression :initarg :expression :initarg nil 
-              :reader sql-error-expression))
+  ((expression :initarg :expression :initarg nil
+               :reader sql-error-expression))
   (:report (lambda (c stream)
-            (format stream "While accessing database ~A~%  with expression ~S:~%  Error ~D / ~A~%  has occurred."
-                    (sql-error-database c)
-                    (sql-error-expression c)
-                    (sql-error-error-id c)
-                    (sql-error-database-message c))))
+             (format stream "While accessing database ~A~%  with expression ~S:~%  Error ~D / ~A~%  has occurred."
+                     (sql-error-database c)
+                     (sql-error-expression c)
+                     (sql-error-error-id c)
+                     (sql-error-database-message c))))
   (:documentation "Used to signal an error with the SQL data
   passed to a database."))
 
@@ -98,11 +98,11 @@ connection is no longer usable."))
 
 (define-condition sql-user-error (sql-error)
   ((message :initarg :message
-           :initform "Unspecified error"
-           :reader sql-user-error-message))
+            :initform "Unspecified error"
+            :reader sql-user-error-message))
   (:report (lambda (c stream)
-            (format stream "A CLSQL lisp code error occurred: ~A "
-                    (sql-user-error-message c))))
+             (format stream "A CLSQL lisp code error occurred: ~A "
+                     (sql-user-error-message c))))
   (:documentation  "Used to signal lisp errors inside CLSQL."))
 
 
@@ -111,15 +111,15 @@ connection is no longer usable."))
 
 (defun signal-closed-database-error (database)
   (error 'sql-fatal-error
-        :database database
-        :connection-spec (when database (connection-spec database))
-        :database-type (when database (database-type database))
-        :message "Database is closed."))
+         :database database
+         :connection-spec (when database (connection-spec database))
+         :database-type (when database (database-type database))
+         :message "Database is closed."))
 
 (defun signal-no-database-error (database)
   (error 'sql-database-error
-        :database database
-        :message (format nil "~A is not a database." database)))
+         :database database
+         :message (format nil "~A is not a database." database)))
 
 
 ;;; CLSQL Extensions
@@ -127,12 +127,12 @@ connection is no longer usable."))
 (define-condition sql-warning (warning sql-condition)
   ((message :initarg :message :initform nil :reader sql-warning-message))
   (:report (lambda (c stream)
-            (format stream "~A" (sql-warning-message c)))))
+             (format stream "~A" (sql-warning-message c)))))
 
 (define-condition sql-database-warning (sql-warning)
   ((database :initarg :database :reader sql-warning-database))
   (:report (lambda (c stream)
-            (format stream 
-                    "While accessing database ~A~%  Warning: ~A~%  has occurred."
-                    (sql-warning-database c)
-                    (sql-warning-message c)))))
+             (format stream
+                     "While accessing database ~A~%  Warning: ~A~%  has occurred."
+                     (sql-warning-database c)
+                     (sql-warning-message c)))))