diff --git a/src/Ssh/Exec.php b/src/Ssh/Exec.php index f951d37..8b73478 100644 --- a/src/Ssh/Exec.php +++ b/src/Ssh/Exec.php @@ -29,7 +29,7 @@ public function run($cmd, $pty = null, array $env = array(), $width = 80, $heigh $output = stream_get_contents($stdout); preg_match('/\[return_code:(.*?)\]/', $output, $match); if ((int) $match[1] !== 0) { - throw new RuntimeException(stream_get_contents($stderr), (int) $match[1]); + throw new RuntimeException(stream_get_contents($stderr) . "\nLast output: " . $output, (int) $match[1]); } return preg_replace('/\[return_code:(.*?)\]/', '', $output);