[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/06: ui: Do not display error messages with bare format strings.
From: |
guix-commits |
Subject: |
01/06: ui: Do not display error messages with bare format strings. |
Date: |
Fri, 24 Jan 2020 18:16:25 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit a07d5e558b5403dad0a59776b950b6b02169c249
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri Jan 24 10:13:10 2020 +0100
ui: Do not display error messages with bare format strings.
On Guile 3, with, say, an error in ~/.guile, we'd get:
$ guix repl
guix repl: error: Unbound variable: ~S
* guix/ui.scm (call-with-error-handling): Add
'&exception-with-kind-and-args' case.
---
guix/ui.scm | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/guix/ui.scm b/guix/ui.scm
index 4857a88..a47dafe 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -770,6 +770,17 @@ directories:~{ ~a~}~%")
(gettext (condition-message c) %gettext-domain))
(display-hint (condition-fix-hint c))
(exit 1))
+
+ ;; On Guile 3.0.0, exceptions such as 'unbound-variable' come are
+ ;; compound and include a '&message'. However, that message only
+ ;; contains the format string. Thus, special-case it here to
+ ;; avoid displaying a bare format string.
+ ((cond-expand
+ (guile-3
+ ((exception-predicate &exception-with-kind-and-args) c))
+ (else #f))
+ (raise c))
+
((message-condition? c)
;; Normally '&message' error conditions have an i18n'd message.
(leave (G_ "~a~%")
- branch master updated (2aa1e76 -> 0ef7e44), guix-commits, 2020/01/24
- 01/06: ui: Do not display error messages with bare format strings.,
guix-commits <=
- 03/06: serialization: 'read-byte-string' makes a single read(2) call., guix-commits, 2020/01/24
- 05/06: gnu: python-pygments: Update to 2.5.2., guix-commits, 2020/01/24
- 02/06: guix build, archive, graph: Disable absolute file port name canonicalization., guix-commits, 2020/01/24
- 06/06: gnu: httpie: Update to 2.0.0., guix-commits, 2020/01/24
- 04/06: gnu: guile-ics: Add "guile3.0-ics" variant., guix-commits, 2020/01/24