Merge pull request #23 from julienj/add-exceptions

throw exception for run, runLocally and uploadFile
This commit is contained in:
elfet 2014-05-28 14:27:18 +04:00
commit 8baaad93ce

View File

@ -64,10 +64,9 @@ class Remote implements RemoteInterface
$this->sftp->mkdir($dir, -1, true); $this->sftp->mkdir($dir, -1, true);
$this->directories[$dir] = true; $this->directories[$dir] = true;
} }
$this->sftp->put($to, $from, NET_SFTP_LOCAL_FILE);
if($this->sftp->getSFTPErrors()) { if(!$this->sftp->put($to, $from, NET_SFTP_LOCAL_FILE)) {
throw new \RuntimeException(current($this->sftp->getSFTPErrors())); throw new \RuntimeException(implode($this->sftp->getSFTPErrors(), "\n"));
} }
} }