Neil Jerram wrote:
Chris Dennis <cgden...@btinternet.com> writes:

Hello Guilers

Hi Chris,

Is there some code anywhere for parsing the error information caught
from local-eval?

The following code is the best I have come up with so far, but the
messages it produces aren't pretty:

  (define (error-handler key . args)
    (display (object->string key))
    (for-each (lambda (arg)
                (display (_ ", arg="))
                (display (object->string arg)))
              args)
    (newline))

  (catch #t (local-eval s-expr (the-environment))
            error-handler)

There's a routine called `handle-system-error' in ice-9/boot-9.scm,
which the REPL uses for printing out "system" errors.  "System" errors
roughly means those generated from the internals of libguile, plus any
application errors that were originated by calling the procedures that
libguile provides for error reporting (node `Error Reporting' in the
manual).

Hope that's some help...

    Neil

Hello Neil

Thank you for your reply. I couldn't get handle-system-error to work, but reading about it led me to display-error, which does what I want.

cheers

Chris

--
Chris Dennis                                  cgden...@btinternet.com
Fordingbridge, Hampshire, UK


Reply via email to