1
0
Fork 0

Resolves #8461: [ZipDownloader] Print `unzip` exit code when the command is failed

pull/8462/head
Sergii Bondarenko 2019-12-03 15:30:08 +04:00
parent e862650571
commit bb127aa3e7
2 changed files with 4 additions and 4 deletions

View File

@ -105,11 +105,11 @@ class ZipDownloader extends ArchiveDownloader
$command = 'unzip -qq '.$overwrite.' '.ProcessExecutor::escape($file).' -d '.ProcessExecutor::escape($path);
try {
if (0 === $this->process->execute($command, $ignoredOutput)) {
if (0 === $exitCode = $this->process->execute($command, $ignoredOutput)) {
return true;
}
$processError = new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
$processError = new \RuntimeException('Failed to execute ('.$exitCode.') '.$command."\n\n".$this->process->getErrorOutput());
} catch (\Exception $e) {
$processError = $e;
}

View File

@ -184,7 +184,7 @@ class ZipDownloaderTest extends TestCase
/**
* @expectedException \Exception
* @expectedExceptionMessage Failed to execute unzip
* @expectedExceptionMessage Failed to execute (1) unzip
*/
public function testSystemUnzipOnlyFailed()
{
@ -310,7 +310,7 @@ class ZipDownloaderTest extends TestCase
/**
* @expectedException \Exception
* @expectedExceptionMessage Failed to execute unzip
* @expectedExceptionMessage Failed to execute (1) unzip
*/
public function testWindowsFallbackFailed()
{