aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-09-01 12:35:10 +0100
committerChristopher Baines <mail@cbaines.net>2019-09-01 13:12:10 +0100
commitf118ed0bf9a4ed9e94722399a787a46f9b0304eb (patch)
tree08de50ed45d5ed5162dbaae2891e0bac6d3d5a59
parent3a7944997409f823a3026e65ab526bfd7b5e381b (diff)
downloaddata-service-f118ed0bf9a4ed9e94722399a787a46f9b0304eb.tar
data-service-f118ed0bf9a4ed9e94722399a787a46f9b0304eb.tar.gz
Improve handling of errors when changing locale
In the load-new-guix-revision module.
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index a138b12..3c2fb45 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -265,14 +265,22 @@ WHERE job_id = $1"
(messages-by-locale
(filter-map
(lambda (locale)
- (setlocale LC_MESSAGES locale)
+ (catch 'system-error
+ (lambda ()
+ (setlocale LC_MESSAGES locale))
+ (lambda (key . args)
+ (error
+ (simple-format
+ #f
+ "error changing locale to ~A: ~A ~A"
+ locale key args))))
(let ((message
(lint-warning-message lint-warning)))
+ (setlocale LC_MESSAGES source-locale)
(if (string=? message source-message)
#f
(cons locale message))))
(list ,@locales))))
- (setlocale LC_MESSAGES "")
(cons (cons source-locale source-message)
messages-by-locale))))
(check package))))