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 #26 received at 41956 <at> debbugs.gnu.org (full text, mbox):

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

Bengt Richter <bokr <at> bokr.com> writes:


[...]

> What do you think of using (ice-9 match) to make a universal throwage-formatter,
> with the idea of making readable top level code for how exceptions become messages on screen?
>
> I started a hack to explore the (throw 'whatever any ...) space, beginning like
>
> (use-modules (ice-9 match))
> (define (make-exception-message key rest)
>   (begin
>     (let*((l (cons key rest)))
>       (match l
> 	     (('system-error subr message args data ...)
> 	      ;; e.g. thrown with key 'system-error: ("open-fdes" "~A" ("No such file or directory") (2))
> 	      (format #f (string-append "match-1: subr ~s threw '~s " message " sterror: ~s") subr key args (strerror (car (car data)))))
>
> 	     (('signal   any ...)
>               ;; not yet implemented
> 	      (format #f "match-2: <NYI:unix signal no> any: ~s" any))

Are you proposing to refactor (ice-9 exceptions) so that it's simpler to
follow a condition message is formed for a given exception type?

Maxim




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.