bug-guile
[Top][All Lists]
Advanced

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

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


From: Maxim Cournoyer
Subject: bug#41956: [PATCH] ice-9: exceptions: Properly format the error message.
Date: Sun, 28 Jun 2020 00:25:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello Bengt,

Bengt Richter <bokr@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





reply via email to

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