From 749215ad8b022f7e2d533f5f82097d2d131eefd6 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 14 Jun 2004 11:02:41 +0000 Subject: [PATCH] r9622: * sql/conditions.lisp: Fix printing of closed-database error --- ChangeLog | 1 + sql/conditions.lisp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9066b78..5c72d76 100644 --- 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 * Version 2.11.9 diff --git a/sql/conditions.lisp b/sql/conditions.lisp index 4e3380f..72c4d31 100644 --- a/sql/conditions.lisp +++ b/sql/conditions.lisp @@ -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) -- 2.34.1