From dd1141eba2cd92cde0fb7c4dc736fac533886a8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Tue, 10 Jan 2017 15:34:11 +0100
Subject: [PATCH] http-client: Improve error reporting.

* guix/http-client.scm (http-fetch): Change message in &message
condition to include URI, CODE, and the reason phrase.
---
 guix/http-client.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/guix/http-client.scm b/guix/http-client.scm
index cc3acc95877..0090783524e 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -276,7 +276,12 @@ (define* (http-fetch uri #:key port (text? #f) (buffered? #t)
                               (code code)
                               (reason (response-reason-phrase resp)))
                              (&message
-                              (message "download failed"))))))))))
+                              (message
+                               (format
+                                #f
+                                (_ "~a: HTTP download failed: ~a (~s)")
+                                (uri->string uri) code
+                                (response-reason-phrase resp))))))))))))
 
 
 ;;;
-- 
GitLab