From fd1a8528d6720c8d87a07b8c8f379ce4caa365f9 Mon Sep 17 00:00:00 2001 From: Dingjun Date: Mon, 7 Aug 2017 14:40:16 +0800 Subject: [PATCH] process ssh connection error --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 8bcdebc..c3f69fb 100644 --- a/client.go +++ b/client.go @@ -74,7 +74,8 @@ func (cc *Client) Run() error { Log(DEBUG, "wait all channel to be done") go cc.registerSignal() go func() { - cc.sshConn.Wait() + cc.err = cc.sshConn.Wait() + Log(DEBUG, "connection hang up") close(cc.ch) }()