r9622: * sql/conditions.lisp: Fix printing of closed-database error
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 14 Jun 2004 11:02:41 +0000 (11:02 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 14 Jun 2004 11:02:41 +0000 (11:02 +0000)
ChangeLog
sql/conditions.lisp

index 9066b78f6978843425745b04c0e5d790b793f0ee..5c72d7678c4871c07021135ef059f93c40329381 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        WRITE-INSTANCE-TO-STREAM and READ-INSTANCE-FROM-STREAM
        * sql/expressions.lisp: Avoid duplicate FROM names when selecting
        from a table that has more than one primary index.
+       * sql/conditions.lisp: Fix printing of closed-database error
        
 13 Jun 2004 Kevin Rosenberg <kevin@rosenberg.net>
        * Version 2.11.9
index 4e3380f7e276d655a460d4af995d08029c492834..72c4d31d1a98eb4a873c23c4b3f6db78c874bf79 100644 (file)
@@ -58,9 +58,11 @@ set to :error to signal an error or :ignore/nil to silently ignore the warning."
                  :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."
-                    (database-name-from-spec
-                     (sql-error-connection-spec c)
-                     (sql-error-database-type c))
+                    (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))))
@@ -111,6 +113,8 @@ 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."))
 
 (defun signal-no-database-error (database)