1
0
Fork 0

Merge pull request #9203 from simonberger/lazy-provider-skip-failed-exception

Do not hard fail on lazy repository when network is disabled and no package cache exists
pull/9232/head
Jordi Boggiano 2020-09-14 21:23:19 +02:00 committed by GitHub
commit 548f346282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -584,8 +584,11 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$packages = $this->fetchFile($url, $cacheKey, $hash, $useLastModifiedCheck);
} catch (TransportException $e) {
// 404s are acceptable for lazy provider repos
if ($e->getStatusCode() === 404 && $this->lazyProvidersUrl) {
if ($this->lazyProvidersUrl && in_array($e->getStatusCode(), array(404, 499), true)) {
$packages = array('packages' => array());
if ($e->getStatusCode() === 499) {
$this->io->error('<warning>' . $e->getMessage() . '</warning>');
}
} else {
throw $e;
}