Show scp output on error
This commit is contained in:
parent
48d8670838
commit
ea76b5a693
|
@ -693,6 +693,11 @@ func (c *comm) scpSession(scpCommand string, f func(io.Writer, *bufio.Reader) er
|
|||
// Otherwise, we have an ExitErorr, meaning we can just read
|
||||
// the exit status
|
||||
log.Printf("non-zero exit status: %d", exitErr.ExitStatus())
|
||||
stdoutB, err := ioutil.ReadAll(stdoutR)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("scp output: %s", stdoutB)
|
||||
|
||||
// If we exited with status 127, it means SCP isn't available.
|
||||
// Return a more descriptive error for that.
|
||||
|
|
Loading…
Reference in New Issue