John Klein <[EMAIL PROTECTED]> writes:

> But is there some way to obtain a backtrace leading to
> the error (eg, to a string) at the location denoted by "HERE"?

Something like this might work:

(defun top ()
  (let (string)
    (multiple-value-bind (ret err)
        (ignore-errors
          (handler-bind ((condition 
                          (lambda (err)
                            (setf string
                                  (with-output-to-string (stream)
                                    (debug:backtrace most-positive-fixnum 
                                                     stream))))))
            (foo)))
      (format t "Got error <~A>~%" err)
      (print string)
      ret)))

Reply via email to