cyrusharmon.org

Cyrus Harmon's new completely useless blog

 

with-java-stack-trace

posted by cyrus in Lisp

Following up on the java stack trace post, here's a little macro that can be used to wrap the lisp code that (eventually) triggers the java-side error:

(defmacro with-java-stack-trace (&body body)  
  `(handler-case   
    ,@body  
    (java:java-exception (e)  
     (print (#"getMessage" e))))) 

Note the use of the java:java-exception in the handler-case clause so that we don't inadvertently trap lisp errors.

with-java-stack-trace