Skip to content
Snippets Groups Projects
Commit c1d52c71 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

ui: Handle SRFI-35 '&message' conditions.

* guix/ui.scm (call-with-error-handling): Add case for
  'message-condition?'.
* po/Makevars: Fix typo in comment.
parent a93e91ff
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ (define-module (guix ui) ...@@ -31,6 +31,7 @@ (define-module (guix ui)
#:use-module (srfi srfi-19) #:use-module (srfi srfi-19)
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:use-module (srfi srfi-34) #:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
#:use-module (srfi srfi-37) #:use-module (srfi srfi-37)
#:autoload (ice-9 ftw) (scandir) #:autoload (ice-9 ftw) (scandir)
#:use-module (ice-9 match) #:use-module (ice-9 match)
...@@ -186,7 +187,10 @@ (define (call-with-error-handling thunk) ...@@ -186,7 +187,10 @@ (define (call-with-error-handling thunk)
((nix-protocol-error? c) ((nix-protocol-error? c)
;; FIXME: Server-provided error messages aren't i18n'd. ;; FIXME: Server-provided error messages aren't i18n'd.
(leave (_ "build failed: ~a~%") (leave (_ "build failed: ~a~%")
(nix-protocol-error-message c)))) (nix-protocol-error-message c)))
((message-condition? c)
;; Normally '&message' error conditions have an i18n'd message.
(leave (_ "~a~%") (gettext (condition-message c)))))
;; Catch EPIPE and the likes. ;; Catch EPIPE and the likes.
(catch 'system-error (catch 'system-error
thunk thunk
......
...@@ -6,7 +6,7 @@ subdir = po ...@@ -6,7 +6,7 @@ subdir = po
top_builddir = .. top_builddir = ..
# These options get passed to xgettext. We want to catch standard # These options get passed to xgettext. We want to catch standard
# gettext uses, package synopses and descriptions, and SRFI-34 error # gettext uses, package synopses and descriptions, and SRFI-35 error
# condition messages. # condition messages.
XGETTEXT_OPTIONS = \ XGETTEXT_OPTIONS = \
--language=Scheme --from-code=UTF-8 \ --language=Scheme --from-code=UTF-8 \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment