Handle 404s gracefully when loading providers in ComposerRepo, fixes #10974
parent
f2141dd3ea
commit
104bf0d75d
|
@ -607,7 +607,14 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
if ($this->providersApiUrl) {
|
if ($this->providersApiUrl) {
|
||||||
$apiResult = $this->httpDownloader->get(str_replace('%package%', $packageName, $this->providersApiUrl), $this->options)->decodeJson();
|
try {
|
||||||
|
$apiResult = $this->httpDownloader->get(str_replace('%package%', $packageName, $this->providersApiUrl), $this->options)->decodeJson();
|
||||||
|
} catch (TransportException $e) {
|
||||||
|
if ($e->getStatusCode() === 404) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($apiResult['providers'] as $provider) {
|
foreach ($apiResult['providers'] as $provider) {
|
||||||
$result[$provider['name']] = $provider;
|
$result[$provider['name']] = $provider;
|
||||||
|
|
Loading…
Reference in New Issue