[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/09: ui: Factorize '&message' handling.
From: |
guix-commits |
Subject: |
05/09: ui: Factorize '&message' handling. |
Date: |
Sat, 25 Jul 2020 13:13:54 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit efe037fc5cc3134bbc3ef4e36b49a3f788921b68
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Jul 25 15:50:36 2020 +0200
ui: Factorize '&message' handling.
* guix/ui.scm (call-with-error-handling): Factorize the three
'message-condition?' clauses into one.
---
guix/ui.scm | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/guix/ui.scm b/guix/ui.scm
index 27bcade..588eb84 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -782,17 +782,14 @@ directories:~{ ~a~}~%")
(invoke-error-stop-signal c)
(cons (invoke-error-program c)
(invoke-error-arguments c))))
- ((and (error-location? c) (message-condition? c))
- (report-error (error-location c) (G_ "~a~%")
+ ((message-condition? c)
+ ;; Normally '&message' error conditions have an i18n'd message.
+ (report-error (and (error-location? c) (error-location c))
+ (G_ "~a~%")
(gettext (condition-message c) %gettext-domain))
(when (fix-hint? c)
(display-hint (condition-fix-hint c)))
(exit 1))
- ((and (message-condition? c) (fix-hint? c))
- (report-error (G_ "~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' are
;; compound and include a '&message'. However, that message only
@@ -806,12 +803,7 @@ directories:~{ ~a~}~%")
(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~%")
- (gettext (condition-message c) %gettext-domain))))
+ (raise c)))
;; Catch EPIPE and the likes.
(catch 'system-error
thunk
- branch master updated (07dbdbd -> 9a63227), guix-commits, 2020/07/25
- 02/09: utils: Remove compatibility re-export of 'memoize'., guix-commits, 2020/07/25
- 03/09: utils: Move '&fix-hint' to (guix diagnostics)., guix-commits, 2020/07/25
- 01/09: utils: Move <location> and '&error-location' to (guix diagnostics)., guix-commits, 2020/07/25
- 05/09: ui: Factorize '&message' handling.,
guix-commits <=
- 06/09: diagnostics: Add a procedural variant of diagnostic procedures., guix-commits, 2020/07/25
- 04/09: file-systems: Convey hint via '&fix-hint'., guix-commits, 2020/07/25
- 07/09: diagnostics: Add '&formatted-message'., guix-commits, 2020/07/25
- 08/09: Use 'formatted-message' instead of '&message' where appropriate., guix-commits, 2020/07/25
- 09/09: guix system: Report file system errors using 'report-error'., guix-commits, 2020/07/25