瀏覽代碼

Include full error message in debug mode

Jordi Boggiano 10 年之前
父節點
當前提交
33badac0a8
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Composer/Downloader/ArchiveDownloader.php

+ 5 - 1
src/Composer/Downloader/ArchiveDownloader.php

@@ -77,7 +77,11 @@ abstract class ArchiveDownloader extends FileDownloader
 
                 // retry downloading if we have an invalid zip file
                 if ($retries && $e instanceof \UnexpectedValueException && class_exists('ZipArchive') && $e->getCode() === \ZipArchive::ER_NOZIP) {
-                    $this->io->writeError('    Invalid zip file, retrying...');
+                    if ($this->io->isDebug()) {
+                        $this->io->writeError('    Invalid zip file ('.$e->getMessage().'), retrying...');
+                    } else {
+                        $this->io->writeError('    Invalid zip file, retrying...');
+                    }
                     usleep(500000);
                     continue;
                 }