summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-05-05 23:24:15 +0200
committerLudovic Courtès <ludo@gnu.org>2021-05-08 14:55:51 +0200
commite2f4a5704be2103cc271969543dff20ad1f3b3d3 (patch)
tree0085ab0aab0f289f898610dac24f08a101736d1b
parente3e0886c2d96aa87d08983ad805f963eb89a7075 (diff)
downloadguix-patches-e2f4a5704be2103cc271969543dff20ad1f3b3d3.tar
guix-patches-e2f4a5704be2103cc271969543dff20ad1f3b3d3.tar.gz
ssh: 'connect-to-remote-daemon' raises a nicer message upon error.
* guix/ssh.scm (connect-to-remote-daemon): Catch 'store-connection-error?' and rethrow.
-rw-r--r--guix/ssh.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix/ssh.scm b/guix/ssh.scm
index 457d1890f9..b39b90f733 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -302,8 +302,13 @@ EXP never returns or calls 'primitive-exit' when it's done."
"/var/guix/daemon-socket/socket"))
"Connect to the remote build daemon listening on SOCKET-NAME over SESSION,
an SSH session. Return a <store-connection> object."
- (open-connection #:port (remote-daemon-channel session socket-name)))
-
+ (guard (c ((store-connection-error? c)
+ ;; Raise a more focused error condition.
+ (raise (formatted-message
+ (G_ "failed to connect over SSH to daemon at '~a', socket ~a")
+ (session-get session 'host)
+ socket-name))))
+ (open-connection #:port (remote-daemon-channel session socket-name))))
(define (store-import-channel session)
"Return an output port to which archives to be exported to SESSION's store