From 41791073db3aa668ad5699598edcb567d4eed966 Mon Sep 17 00:00:00 2001 From: Attila Lendvai Date: Sun, 2 Jan 2011 16:41:47 +0100 Subject: [PATCH] Make the printing of a slot-unbound error more error tolerant. Especially against errors coming from custom PRINT-OBJECT methods, in which case only print the TYPE-OF the instance. Also, print fully qualified symbol names. Slightly modified by Paul Khuong. --- src/pcl/slots.lisp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/pcl/slots.lisp b/src/pcl/slots.lisp index 71746aa..2ae32b0 100644 --- a/src/pcl/slots.lisp +++ b/src/pcl/slots.lisp @@ -28,9 +28,19 @@ (define-condition unbound-slot (cell-error) ((instance :reader unbound-slot-instance :initarg :instance)) (:report (lambda (condition stream) - (format stream "The slot ~S is unbound in the object ~S." - (cell-error-name condition) - (unbound-slot-instance condition))))) + (handler-case + (format stream "~@" + (cell-error-name condition) + (unbound-slot-instance condition)) + (serious-condition () + ;; In case of an error try again avoiding custom PRINT-OBJECT's. + (format stream "~&Error during printing.~%~@" + (cell-error-name condition) + (type-of (unbound-slot-instance condition)))))))) (defmethod wrapper-fetcher ((class standard-class)) 'std-instance-wrapper) -- 1.7.10.4