Просмотр исходного кода

Fix exception handling when loading repos

Jordi Boggiano 12 лет назад
Родитель
Сommit
c14826dd1e
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/Composer/Repository/ComposerRepository.php

+ 1 - 1
src/Composer/Repository/ComposerRepository.php

@@ -268,7 +268,7 @@ class ComposerRepository extends ArrayRepository implements NotifiableRepository
         try {
             return $this->loader->load($data, 'Composer\Package\CompletePackage');
         } catch (\Exception $e) {
-            throw new \RuntimeException('Could not load package '.$data['name'].' in '.$this->url.': ['.get_class($e).'] '.$e->getMessage());
+            throw new \RuntimeException('Could not load package '.(isset($data['name']) ? $data['name'] : json_encode($data)).' in '.$this->url.': ['.get_class($e).'] '.$e->getMessage(), 0, $e);
         }
     }
 }