From c9c2823f6264fb860d4f09c5386ba78e5f2223f3 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Tue, 12 Sep 2017 17:40:33 -0500 Subject: [PATCH] communicator/ssh: add what error details we can for the user ssh.Waitmsg's String() method provides output which can include the process status, signal, and message --- communicator/ssh/communicator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 491a62c3f..4ad67aefc 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -467,7 +467,7 @@ func (c *Communicator) scpSession(scpCommand string, f func(io.Writer, *bufio.Re if exitErr, ok := err.(*ssh.ExitError); ok { // Otherwise, we have an ExitErorr, meaning we can just read // the exit status - log.Printf("non-zero exit status: %d", exitErr.ExitStatus()) + log.Printf(exitErr.String()) // If we exited with status 127, it means SCP isn't available. // Return a more descriptive error for that.