mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 03:51:53 +02:00
swh: Catch swh-error when downloading from SWH Vault.
* guix/swh.scm (swh-download): Catch 'swh-error' and display the error message. Change-Id: I2965d8b71023a938a5ba7eba454c6ec109fdcc54 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
committed by
Ludovic Courtès
parent
dd25c5a6f2
commit
758e79730c
+13
-4
@@ -2,7 +2,7 @@
|
|||||||
;;; Copyright © 2018-2021, 2024 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2018-2021, 2024 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
|
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
|
||||||
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
|
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
|
||||||
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
|
;;; Copyright © 2021, 2025 Simon Tournier <zimon.toutoune@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
@@ -802,9 +802,13 @@ and #f on failure.
|
|||||||
This procedure uses the \"vault\", which contains \"cooked\" directories in
|
This procedure uses the \"vault\", which contains \"cooked\" directories in
|
||||||
the form of tarballs. If the requested directory is not cooked yet, it will
|
the form of tarballs. If the requested directory is not cooked yet, it will
|
||||||
wait until it becomes available, which could take several minutes."
|
wait until it becomes available, which could take several minutes."
|
||||||
(match (if (commit-id? reference)
|
(match (catch 'swh-error
|
||||||
(lookup-revision reference)
|
(lambda ()
|
||||||
(lookup-origin-revision url reference))
|
(if (commit-id? reference)
|
||||||
|
(lookup-revision reference)
|
||||||
|
(lookup-origin-revision url reference)))
|
||||||
|
(lambda (key url method response)
|
||||||
|
response))
|
||||||
((? revision? revision)
|
((? revision? revision)
|
||||||
(format log-port "SWH: found revision ~a with directory at '~a'~%"
|
(format log-port "SWH: found revision ~a with directory at '~a'~%"
|
||||||
(revision-id revision)
|
(revision-id revision)
|
||||||
@@ -819,6 +823,11 @@ wait until it becomes available, which could take several minutes."
|
|||||||
output
|
output
|
||||||
#:archive-type archive-type
|
#:archive-type archive-type
|
||||||
#:log-port log-port))
|
#:log-port log-port))
|
||||||
|
((? response? response)
|
||||||
|
(format log-port
|
||||||
|
"SWH: error: ~a~%"
|
||||||
|
(response-reason-phrase response))
|
||||||
|
#f)
|
||||||
(#f
|
(#f
|
||||||
(format log-port
|
(format log-port
|
||||||
"SWH: revision ~s originating from ~a could not be found~%"
|
"SWH: revision ~s originating from ~a could not be found~%"
|
||||||
|
|||||||
Reference in New Issue
Block a user