substitute: Retry nar download upon networking error.
This allows ‘guix substitute’ to gracefully handle errors like: TLS error in procedure 'write_to_session_record_port': Error in the push function instead of exiting (“`guix substitute' died unexpectedly”). * guix/scripts/substitute.scm (download-nar)[try-fetch]: Catch ‘network-error?’ too. Reported-by: Ada Stevenson <adanskana@gmail.com> Change-Id: I91b92183b0165832645ee37d50c13445f9322525
This commit is contained in:
parent
80a135d64b
commit
ddc9d66f2b
1 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013-2023 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013-2024 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
|
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
|
||||||
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
|
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
|
||||||
;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
|
;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
|
||||||
|
@ -494,7 +494,9 @@ STATUS-PORT."
|
||||||
(define (try-fetch choices)
|
(define (try-fetch choices)
|
||||||
(match choices
|
(match choices
|
||||||
(((uri compression file-size) rest ...)
|
(((uri compression file-size) rest ...)
|
||||||
(guard (c ((and (pair? rest) (http-get-error? c))
|
(guard (c ((and (pair? rest)
|
||||||
|
(or (http-get-error? c)
|
||||||
|
(network-error? c)))
|
||||||
(warning (G_ "download from '~a' failed, trying next URL~%")
|
(warning (G_ "download from '~a' failed, trying next URL~%")
|
||||||
(uri->string uri))
|
(uri->string uri))
|
||||||
(try-fetch rest)))
|
(try-fetch rest)))
|
||||||
|
|
Reference in a new issue