X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fconditions.cl;h=c669cddc059fe6e07d861fdbdda0990bb49f3e01;hb=bff42e25aef90305a6e779d4477859cf9918e653;hp=af6822cafccc2a5444fe456584a4eaaebc0d8b68;hpb=30656549f102f19d3cedba9e2b6e30fc763ea20d;p=clsql.git diff --git a/sql/conditions.cl b/sql/conditions.cl index af6822c..c669cdd 100644 --- a/sql/conditions.cl +++ b/sql/conditions.cl @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: conditions.cl,v 1.1 2002/03/29 07:42:10 kevin Exp $ +;;;; $Id: conditions.cl,v 1.2 2002/03/29 08:12:16 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -138,3 +138,23 @@ although there is an existing connection (~A)." (format stream "The database ~A has already been closed." (clsql-closed-error-database c))))) +(define-condition clsql-nodb-error (clsql-error) + ((database :initarg :database :reader clsql-nodb-error-database)) + (:report (lambda (c stream) + (format stream "No such database ~S is open." + (clsql-nodb-error-database c))))) + + +;; Signal conditions + + +(defun signal-closed-database-error (database) + (cerror "Ignore this error and return nil." + 'clsql-closed-error + :database database)) + +(defun signal-nodb-error (database) + (cerror "Ignore this error and return nil." + 'clsql-nodb-error + :database database)) +