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.
This commit is contained in:
parent
2aa1e76519
commit
a07d5e558b
1 changed files with 11 additions and 0 deletions
11
guix/ui.scm
11
guix/ui.scm
|
@ -770,6 +770,17 @@ (define (manifest-entry-output* entry)
|
|||
(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~%")
|
||||
|
|
Loading…
Reference in a new issue