Hello,

I have a question about obtaining a backtrace when
catching errors.

consider the following snippet of code:

;;;;;;;;;;;;;;;;;;;
(defun top ()
  (multiple-value-bind (ret err) (ignore-errors (foo))
    (when err (format t "Got error <~A>~%" err))
    ;; HERE
    ret))

(defun foo () (bar 0))
(defun bar (x) (/ 1 x)) ;; bar causes an error for x=0
;;;;;;;;;;;;;;;;;;;

This catches and prints a division by 0 error when (top)
is evaluated.

But is there some way to obtain a backtrace leading to
the error (eg, to a string) at the location denoted by "HERE"?
This would be very useful for diagnosing infrequent errors
in server apps, eg.

Obviously, putting in (debug:backtrace) doesn't work because
we are out of the frame (?) where the error occurred.





__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

Reply via email to