diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-04-06 12:00:29 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-04-06 12:00:29 +0200 |
commit | 933d2fe4cfb380f66af631a2203ec23c367e5b1a (patch) | |
tree | f10581ed0da1911eed9b02e69d999ba481d9d3c6 /guix/scripts/substitute.scm | |
parent | f8835ff4b3dd59d59bf44838d05d3d60114d15d2 (diff) | |
parent | 998afc3608242b75051f43ece36d52474c51e285 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts/substitute.scm')
-rwxr-xr-x | guix/scripts/substitute.scm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 4563f3df0f..82ce069598 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -780,16 +780,24 @@ PORT. REPORT-PROGRESS is a two-argument procedure such as that returned by (define-syntax with-networking (syntax-rules () - "Catch DNS lookup errors and gracefully exit." + "Catch DNS lookup errors and TLS errors and gracefully exit." ;; Note: no attempt is made to catch other networking errors, because DNS ;; lookup errors are typically the first one, and because other errors are ;; a subset of `system-error', which is harder to filter. ((_ exp ...) - (catch 'getaddrinfo-error + (catch #t (lambda () exp ...) - (lambda (key error) - (leave (_ "host name lookup error: ~a~%") - (gai-strerror error))))))) + (match-lambda* + (('getaddrinfo-error error) + (leave (_ "host name lookup error: ~a~%") + (gai-strerror error))) + (('gnutls-error error proc . rest) + (let ((error->string (module-ref (resolve-interface '(gnutls)) + 'error->string))) + (leave (_ "TLS error in procedure '~a': ~a~%") + proc (error->string error)))) + (args + (apply throw args))))))) ;;; |