GNU bug report logs - #41956
[PATCH] ice-9: exceptions: Properly format the error message.

Previous Next

Package: guile;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Fri, 19 Jun 2020 21:34:01 UTC

Severity: normal

Tags: patch

Full log


Message #29 received at 41956 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Bengt Richter <bokr <at> bokr.com>, 41956 <at> debbugs.gnu.org
Subject: Re: bug#41956: [PATCH] ice-9: exceptions: Properly format the error
 message.
Date: Sun, 28 Jun 2020 06:31:44 +0200
Hi Maxim,

>> here’s what I did in the REPL:
>>
>> scheme@(guile-user)> ,m (ice-9 exceptions)
>> scheme@(ice-9 exceptions)> (define (my/guile-system-error-converter key args)
>>   (apply (case-lambda
>>           ((subr msg-args msg errno . rest)

Here I changed the order: “msg-args” appears before “msg”.  I don’t know
why the converter that’s currently in Guile assumes that the message
comes first.

>> scheme@(ice-9 exceptions)> (set! guile-exception-converters (acons 'system-error my/guile-system-error-converter guile-exception-converters))

guile-exception-converters is a lookup table in (ice-9 exceptions).  It
associates error keys with converter procedures.  Since
canonicalize-path throws a 'system-error I chose to only update the
'system-error association.  I didn’t want to affect all the other
converter procedures that end up using the common converter; maybe they
should be affected — I don’t know because I don’t have any test cases
other than canonicalize-path.

> This brings embeds the definition of `guile-common-exceptions' into
> `guile-system-error-converter', with a single change:
>
> (make-exception-with-message msg) --> (apply make-exception-with-message
> msg msg-args)
>
> What is the magic I fail to see?

I cannot parse your sentence, so I’m not sure what you mean.

> Is this fix proper to be merged into the original
> guile-common-exceptions procedure?

I think we should add tests of different exceptions with different keys
to be sure that modifying the common handler doesn’t have any unexpected
side-effects.

-- 
Ricardo




This bug report was last modified 1 year and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.