diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php
index 8d8bcbdca..18785c4e7 100644
--- a/src/Composer/Repository/VcsRepository.php
+++ b/src/Composer/Repository/VcsRepository.php
@@ -45,6 +45,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
/** @var VersionCacheInterface */
private $versionCache;
private $emptyReferences = array();
+ private $versionTransportExceptions = array();
public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null, VersionCacheInterface $versionCache = null)
{
@@ -125,6 +126,11 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
return $this->emptyReferences;
}
+ public function getVersionTransportExceptions()
+ {
+ return $this->versionTransportExceptions;
+ }
+
protected function initialize()
{
parent::initialize();
@@ -226,11 +232,14 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
$this->addPackage($this->loader->load($this->preProcess($driver, $data, $identifier)));
} catch (\Exception $e) {
- if ($e instanceof TransportException && $e->getCode() === 404) {
- $this->emptyReferences[] = $identifier;
+ if ($e instanceof TransportException) {
+ $this->versionTransportExceptions['tags'][$tag] = $e;
+ if ($e->getCode() === 404) {
+ $this->emptyReferences[] = $identifier;
+ }
}
if ($isVeryVerbose) {
- $this->io->writeError('Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()).'');
+ $this->io->writeError('Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found (' . $e->getCode() . ' HTTP status code)' : $e->getMessage()).'');
}
continue;
}
@@ -306,11 +315,12 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
}
$this->addPackage($package);
} catch (TransportException $e) {
+ $this->versionTransportExceptions['branches'][$branch] = $e;
if ($e->getCode() === 404) {
$this->emptyReferences[] = $identifier;
}
if ($isVeryVerbose) {
- $this->io->writeError('Skipped branch '.$branch.', no composer file was found');
+ $this->io->writeError('Skipped branch '.$branch.', no composer file was found (' . $e->getCode() . ' HTTP status code)');
}
continue;
} catch (\Exception $e) {