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

main
Sergii Bondarenko 5 years ago
parent e862650571
commit bb127aa3e7

@ -105,11 +105,11 @@ class ZipDownloader extends ArchiveDownloader
$command = 'unzip -qq '.$overwrite.' '.ProcessExecutor::escape($file).' -d '.ProcessExecutor::escape($path); $command = 'unzip -qq '.$overwrite.' '.ProcessExecutor::escape($file).' -d '.ProcessExecutor::escape($path);
try { try {
if (0 === $this->process->execute($command, $ignoredOutput)) { if (0 === $exitCode = $this->process->execute($command, $ignoredOutput)) {
return true; 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) { } catch (\Exception $e) {
$processError = $e; $processError = $e;
} }

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

Loading…
Cancel
Save