chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] how to access all error info in with-exception-handler?


From: Heinrich Taube
Subject: [Chicken-users] how to access all error info in with-exception-handler?
Date: Fri, 28 Mar 2008 16:34:48 -0500

I have an error handler that traps errors under callbacks using with- exception-handler. its wroking quite well except that I dont know how to get all the error information to print out. for example if i eval an unbound symbol in the REPL the message includes the name of the offending symbol:

#;50> baz
Error: unbound variable: baz

now, when i trap the same error in an environmentn with my error handler all i seem to get is the first part of the string, ie the message without the symbol name:

>>> Error: unbound variable

my question is: how can i get a string that will contain what error messages normally show in the repl??

here what my with-exception-handler looks like (its only part of the macroexpantion so not everytnig is shown, just pretend print-error calls display, etc:)

(call-with-current-continuation
        (lambda (%%stopproc%%)
          (with-exception-handler
            (lambda (err112)
              (print-error
                (sprintf
                  ">>> Error: ~A~%"
                  ((condition-property-accessor 'exn 'message) err112)
                 ))
              (%%stopproc%% -2))
            (lambda ()
              (if (>= v108 v109) (begin (%%stopproc%% -1)))
              (print "hiho")
              (set! v108 (+ v108 1))
              wait111))))


thansk for any info,
--rick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]