From bde8c0e6d9c7d943cf09c8fd4bc3201ab8f4799e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Fri, 4 Apr 2014 20:37:27 +0200
Subject: [PATCH] ui: Improve reporting of 'system-error' exceptions.

* guix/ui.scm (call-with-error-handling): Change 'system-error' handler
  to display the error message as it was raised.
---
 guix/ui.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index c232b326744..dcad55e72e0 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -194,9 +194,9 @@ (define (call-with-error-handling thunk)
     ;; Catch EPIPE and the likes.
     (catch 'system-error
       thunk
-      (lambda args
-        (leave (_ "~a~%")
-               (strerror (system-error-errno args)))))))
+      (lambda (key proc format-string format-args . rest)
+        (leave (_ "~a: ~a~%") proc
+               (apply format #f format-string format-args))))))
 
 (define (read/eval str)
   "Read and evaluate STR, raising an error if something goes wrong."
-- 
GitLab