Skip to content

Commit

Permalink
Specialize the catch of exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
francoispluchino committed Aug 8, 2019
1 parent f2eed0c commit ee835cf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Repository/AssetVcsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Composer\Package\BasePackage;
use Composer\Package\CompletePackageInterface;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Loader\InvalidPackageException;
use Composer\Package\PackageInterface;
use Composer\Repository\InvalidRepositoryException;
use Composer\Repository\Vcs\VcsDriverInterface;
Expand All @@ -31,6 +32,8 @@ class AssetVcsRepository extends AbstractAssetVcsRepository
{
/**
* {@inheritdoc}
*
* @throws
*/
protected function initialize()
{
Expand All @@ -47,6 +50,8 @@ protected function initialize()

/**
* Init the driver with branches and tags.
*
* @throws
*/
protected function initFullDriver()
{
Expand All @@ -57,6 +62,11 @@ protected function initFullDriver()
$this->initBranches($driver);
$driver->cleanup();
} catch (\Exception $e) {
if (!$e instanceof \InvalidArgumentException
&& !$e instanceof InvalidPackageException && !$e instanceof InvalidRepositoryException) {
throw $e;
}

// do nothing
}
}
Expand Down

0 comments on commit ee835cf

Please sign in to comment.