chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] ssax parser error


From: Daishi Kato
Subject: Re: [Chicken-users] ssax parser error
Date: Tue, 11 Jul 2006 15:07:02 +0900
User-agent: Wanderlust/2.15.3 (Almost Unreal) Emacs/21.4 Mule/5.0 (SAKAKI)

At Tue, 11 Jul 2006 07:22:22 +0200,
felix winkelmann wrote:
> 
> On 7/11/06, Daishi Kato <address@hidden> wrote:
> > Hi,
> >
> > The parser error raised from the ssax egg
> > does not seem to have a "type" so that
> > one can catch the exception.
> >
> > Should it be something like the following?
> > Daishi
> >
> > (define (parser-error port msg . specializing-msgs)
> >   (make-composite-condition
> >     (make-property-condition 'ssax)
> >     (make-property-condition 'exn 'message msg 'specializing-msgs 
> > specializing-msgs)))
> >
> > I'm not sure how to handle `port.'
> 
> Usually, a condition of type "exn" has "message" (string),
> "location" (symbol, name of the function) and "arguments"
> properties. The latter holds a list of arguments (usually the
> arguments passed to "error"). I recommend to invoke
> m-p-c with "... 'arguments (list port)...", or even add a "port"
> property to the ssax condition (that might be better, I'd say).

Hm, I'm not yet used to the exceptions.
How about this?
If OK, do you want me to commit it?
Or somebody (a first commiter?) should do it.
Daishi

--- ssax-core.scm       (revision 1205)
+++ ssax-core.scm       (working copy)
@@ -1599,7 +1599,10 @@
 ; Normally the definition of parser-error is to be provided by the user.
 (run-test
  (define (parser-error port msg . specializing-msgs)
-   (apply error (cons msg specializing-msgs)))
+   (signal
+    (make-composite-condition
+     (make-property-condition 'ssax 'port port)
+     (make-property-condition 'exn 'message (apply string-append msg 
specializing-msgs)))))
 )

 ; The following is a function that is often used in validation tests,




reply via email to

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