Hello,

What do you think of the following diff?

It also displays the CL type of the condition (using TYPE-OF), rather
than only its user ":report method" representation.

Without this, while developing new code it's quite hard to know what
condition type to handle when only the user-printable representation is
shown.  Some time is then wasted to reproduce the condition while using
a custom catch-all error reporter to determine what is really signaled,
or to check third party sources.  SBCL also shows the condition type
for convenience.

Because the user report method representation may be complex and
multiline, the condition type is printed separately, followed by a new
line, then the user-printable one (the one that used to be shown).

Thanks,
-- 
Matt
Index: ./src/lsp/top.lsp
===================================================================
RCS file: /cvsroot/ecls/ecl/src/lsp/top.lsp,v
retrieving revision 1.91
diff -u -r1.91 top.lsp
--- ./src/lsp/top.lsp   22 Oct 2010 22:55:07 -0000      1.91
+++ ./src/lsp/top.lsp   19 Jan 2011 20:49:59 -0000
@@ -573,8 +573,9 @@
                            ;; We are told to let the debugger handle this.
                            )
                           (t
-                           (format t "~&Debugger received error: ~A~%~
-                                         Error flushed.~%" condition)
+                           (format t "~&Debugger received error of type: 
~A~%~A~%~
+                                         Error flushed.~%"
+                                   (type-of condition) condition)
                            (clear-input)
                            (return-from rep t) ;; go back into the debugger 
loop.
                            )
@@ -660,7 +661,8 @@
     (handler-bind 
      ((error (lambda (condition)
               (unless *debug-tpl-commands*
-                (format t "~&Command aborted.~%Received condition: ~A" 
condition)
+                (format t "~&Command aborted.~%Received condition of type: 
~A~%~A"
+                        (type-of condition) condition)
                 (clear-input)
                 (return-from tpl-command nil)
                 )
@@ -1417,7 +1419,8 @@
            (*print-pretty* nil)
            (*print-circle* t)
            (*readtable* (or *break-readtable* *readtable*))
-           (*break-message* (format nil "~&~A~%" condition))
+           (*break-message* (format nil "~&Condition of type: ~A~%~A~%"
+                                   (type-of condition) condition))
            (*break-level* (1+ *break-level*))
            (break-level *break-level*)
            (*break-env* nil))
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to