Changeset 11390


Ignore:
Timestamp:
11/15/08 22:12:31 (13 years ago)
Author:
ehuelsmann
Message:

Make JAVA-EXCEPTION objects print more human readable.

Inspired by: Mark Evenson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/print-object.lisp

    r11297 r11390  
    2121
    2222(require 'clos)
     23(require 'java)
    2324
    2425(when (autoloadp 'print-object)
     
    105106      (format stream "The variable ~S is unbound." (cell-error-name x))))
    106107
     108(defmethod print-object ((e java:java-exception) stream)
     109  (if *print-escape*
     110      (print-unreadable-object (e stream :type t :identity t)
     111        (format stream "~A"
     112                (java:jcall (java:jmethod "java.lang.Object" "toString")
     113                            (java:java-exception-cause e))))
     114      (format stream "Java exception '~A'."
     115              (java:jcall (java:jmethod "java.lang.Object" "toString")
     116                          (java:java-exception-cause e)))))
     117
    107118(provide 'print-object)
Note: See TracChangeset for help on using the changeset viewer.