diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-08-31 21:03:16 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-08-31 21:04:09 +0200 |
commit | 900e0fbcc4626bdf57e455836f86367e3ec36d69 (patch) | |
tree | 653600191db41fc4fea30693058517f0e2e7df3b | |
parent | 2c0040ae302fa8549161754283b404b9dd22a619 (diff) | |
download | patches-900e0fbcc4626bdf57e455836f86367e3ec36d69.tar patches-900e0fbcc4626bdf57e455836f86367e3ec36d69.tar.gz |
lint: Gracefully handle errors from 'connect' & co.
* guix/lint.scm (call-with-networking-fail-safe): Add case for
'system-error' as typically raised by 'connect' & co.
-rw-r--r-- | guix/lint.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/guix/lint.scm b/guix/lint.scm index 2bf5097403..254f4e2830 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -950,6 +950,16 @@ display a message including MESSAGE and return ERROR-VALUE." message (tls-certificate-error-string args)) error-value) + ((and ('system-error _ ...) args) + (let ((errno (system-error-errno args))) + (if (member errno (list ECONNRESET ECONNABORTED ECONNREFUSED)) + (let ((details (call-with-output-string + (lambda (port) + (print-exception port #f (car args) + (cdr args)))))) + (warning (G_ "~a: ~a~%") message details) + error-value) + (apply throw args)))) (args (apply throw args)))))) |