diff --git a/src/Composer/Downloader/ZipDownloader.php b/src/Composer/Downloader/ZipDownloader.php index 6534db3d8..8aca21e59 100644 --- a/src/Composer/Downloader/ZipDownloader.php +++ b/src/Composer/Downloader/ZipDownloader.php @@ -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; } diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index 239ec9221..4ff3f055c 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -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() {