guile-user
[Top][All Lists]
Advanced

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

Re: Parsing eval errors


From: Chris Dennis
Subject: Re: Parsing eval errors
Date: Sun, 14 Jun 2009 15:40:29 +0100
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Neil Jerram wrote:
Chris Dennis <address@hidden> 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                                  address@hidden
Fordingbridge, Hampshire, UK




reply via email to

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