[plt-scheme] Exception handling outside of Dr Scheme

From: Vincent Rayappa (vrayappa at gmail.com)
Date: Wed Jan 30 09:21:14 EST 2008

Hello,

If I am using PLT Scheme outside of Dr. Scheme (via the Unix shebang
notation), how do I get stack traces from a 'handled exception'?

For example:

(define (handle-error-p exn) #t)

(define (exception-handler exn)
    (printf "Exception caught: ~a ~n" exn)
    ;; --- How can I print the stack trace here inside the handler?
    (do-clean-up))

(with-handlers
  ((handle-error-p exception-handler))
  (do-something ...)))

---

How would I get the stack track inside exception-handler? I looked at
http://schemecookbook.org/view/Cookbook/GettingStartedExceptions and
it is not clear to me how I do this.

Any help you can provide is much appreciated.

Thanks,
Vincent.


> Date: Tue, 29 Jan 2008 12:31:36 -0700
> From: Matthew Flatt <mflatt at cs.utah.edu>
> Subject: Re: [plt-scheme] stack trace?
> To: "Stephen De Gabrielle" <spdegabrielle at gmail.com>
> Cc: pltscheme <plt-scheme at list.cs.brown.edu>
> Message-ID: <20080129193136.C46406500AF at mail-svr1.cs.utah.edu>
> Content-Type: text/plain; charset=UTF-8

>
>
> Is there a bug icon next to that message? If so, clicking it should
> show you the stack trace.
>


Posted on the users mailing list.