[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/10: http-client: Add response headers to '&http-get-error'.
From: |
guix-commits |
Subject: |
02/10: http-client: Add response headers to '&http-get-error'. |
Date: |
Sun, 6 Mar 2022 16:51:07 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit ecad9b221364c5c941385eaac3a652e2bd42d1ac
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Mar 3 20:38:36 2022 +0100
http-client: Add response headers to '&http-get-error'.
* guix/http-client.scm (&http-get-error)[headers]: New field.
(http-fetch): Initialize the 'headers' field.
---
guix/http-client.scm | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/guix/http-client.scm b/guix/http-client.scm
index 10bc278023..4b01e31165 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021 Ludovic
Courtès <ludo@gnu.org>
+;;; Copyright © 2012-2018, 2020-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2012, 2015 Free Software Foundation, Inc.
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -52,6 +52,7 @@
http-get-error-uri
http-get-error-code
http-get-error-reason
+ http-get-error-headers
http-fetch
http-multiple-get
@@ -69,9 +70,10 @@
;; HTTP GET error.
(define-condition-type &http-get-error &error
http-get-error?
- (uri http-get-error-uri) ; URI
- (code http-get-error-code) ; integer
- (reason http-get-error-reason)) ; string
+ (uri http-get-error-uri) ;URI
+ (code http-get-error-code) ;integer
+ (reason http-get-error-reason) ;string
+ (headers http-get-error-headers)) ;alist
(define* (http-fetch uri #:key port (text? #f) (buffered? #t)
@@ -138,7 +140,8 @@ Raise an '&http-get-error' condition if downloading fails."
(raise (condition (&http-get-error
(uri uri)
(code code)
- (reason (response-reason-phrase resp)))
+ (reason (response-reason-phrase resp))
+ (headers (response-headers resp)))
(&message
(message
(format
- branch master updated (f75becbb36 -> afb9f27523), guix-commits, 2022/03/06
- 02/10: http-client: Add response headers to '&http-get-error'.,
guix-commits <=
- 03/10: import: github: Gracefully handle rate limit exhaustion., guix-commits, 2022/03/06
- 05/10: import: github: Reuse HTTP connection for the /tags URL fallback., guix-commits, 2022/03/06
- 06/10: gnu: cgdb: Reference gdb., guix-commits, 2022/03/06
- 09/10: gnu: Add jtdx., guix-commits, 2022/03/06
- 01/10: tests: Add (guix http-client) tests., guix-commits, 2022/03/06
- 07/10: gnu: gnome-shell-extension-gsconnect: Update to 48, guix-commits, 2022/03/06
- 10/10: gnu: Add python-xmldiff., guix-commits, 2022/03/06
- 04/10: http-client: Correctly handle redirects when #:keep-alive? #t., guix-commits, 2022/03/06
- 08/10: gnu: Add python-stltools., guix-commits, 2022/03/06