GNU bug report logs -
#41956
[PATCH] ice-9: exceptions: Properly format the error message.
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
I had this problem in Guix where 'guix deploy my-config.scm' would
unhelpfully report an error like:
guix deploy: error: failed to deploy my-host: ~A: ~S
Digging a bit, I could reproduce at the REPL with:
--8<---------------cut here---------------start------------->8---
(guard (c ((message-condition? c)
(format #t "error: ~a~%" (condition-message c))))
;; This is what (canonicalize-path "/do/not/exist) ends up doing:
(throw 'system-error "canonicalize-path" "~A" '("No such file or directory")))
--> error: ~A
--8<---------------cut here---------------end--------------->8---
It seems our native -> srfi-34 style exception converter should populate
the message field with a formatted message, given that's what happens to
present errors as explained in libguile/error.c:
When an error is reported,\n
"these are replaced by formatting the corresponding members of\n"
"@var{args}: @code{~A} (was @code{%s} in older versions of\n"
"Guile) formats using @code{display} and @code{~S}
I'm not sure about the second ~S that appeared in the Guix output;
possibly the exception got re-thrown and suffered from a slightly
different conversion problem?
Anyway, the simple patch attached should fix the "~A" exception message.
Thank you,
Maxim
[0001-ice-9-exceptions-Properly-format-the-error-message.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 305 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.