GNU bug report logs -
#50814
[PATCH] guix: git-authenticate: Also authenticate the channel intro commit.
Previous Next
Full log
Message #34 received at 50814 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Attila Lendvai schreef op ma 27-09-2021 om 18:45 [+0000]:
>
[...]
> using `(warning ...)` will just print something to stderr.
>
> i was hoping to raise a continuable condition of type &warning, that i can even check for in the tests,
> but i have failed to put that together. the scheme/guile condition system is a bit messy/convoluted.
Technically, Scheme supports continuable exceptions with 'raise-continuable'
and with-exception-hander. E.g., the following Racket example:
(use-modules (rnrs exceptions) (rnrs conditions))
(with-exception-handler
(lambda (con)
(cond
((not (warning? con))
(raise con))
((message-condition? con)
(display (condition-message con)))
(else
(display "a warning has been issued")))
42)
(lambda ()
(+ (raise-continuable
(condition
(make-warning)
(make-message-condition
"should be a number")))
23)))
prints: should be a number
⇒ 65
(from https://docs.racket-lang.org/r6rs/r6rs-lib-std/r6rs-lib-Z-H-8.html#node_idx_378)
works in Guile
You might need to modify 'call-with-error-handling' in (guix ui) to recognise
&warning though, such that the &warning exception will be properly handled.
Alternatively, you can use the procedure 'warning' from (guix diagnostics).
To detect the error in this case, you can use parameterise, guix-warning-port
and procedures like call-with-output-string. You may need to reset the locale
first (with dynamic-wind?).
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 72 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.