diff --git a/src/PrestissimoFileFetcher.php b/src/PrestissimoFileFetcher.php index a1f8e70..fe8f4d3 100644 --- a/src/PrestissimoFileFetcher.php +++ b/src/PrestissimoFileFetcher.php @@ -54,10 +54,11 @@ protected function fetchWithPrestissimo($version, $destination, $override) { } $successCnt = $failureCnt = 0; + $errors = []; $totalCnt = count($requests); if ($totalCnt == 0) { return; - } + } $multi = new CurlMulti(); $multi->setRequests($requests); @@ -67,12 +68,18 @@ protected function fetchWithPrestissimo($version, $destination, $override) { $result = $multi->getFinishedResults(); $successCnt += $result['successCnt']; $failureCnt += $result['failureCnt']; + $errors += $result['errors']; if ($this->progress) { foreach ($result['urls'] as $url) { $this->io->writeError(" - Downloading $successCnt/$totalCnt: $url", TRUE); } } } while ($multi->remain()); + + $urls = array_keys($errors); + if ($urls) { + throw new \Exception('Failed to download ' . implode(", ", $urls)); + } } }