|
61 | 61 | use Pagerfanta\Doctrine\ORM\QueryAdapter; |
62 | 62 | use Pagerfanta\Pagerfanta; |
63 | 63 | use Predis\Client as RedisClient; |
64 | | -use Predis\Connection\ConnectionException; |
| 64 | +use Predis\PredisException; |
65 | 65 | use Psr\Log\LoggerInterface; |
66 | 66 | use Symfony\Bridge\Doctrine\Attribute\MapEntity; |
67 | 67 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
@@ -418,7 +418,7 @@ public function viewProvidersAction(Request $req, string $name, RedisClient $red |
418 | 418 |
|
419 | 419 | return $trendiness[$a->getId()] > $trendiness[$b->getId()] ? -1 : 1; |
420 | 420 | }); |
421 | | - } catch (ConnectionException $e) { |
| 421 | + } catch (PredisException $e) { |
422 | 422 | } |
423 | 423 |
|
424 | 424 | if ($req->getRequestFormat() === 'json') { |
@@ -581,7 +581,7 @@ public function viewPackageAction(Request $req, string $name, CsrfTokenManagerIn |
581 | 581 | } |
582 | 582 | $data['downloads'] = $this->downloadManager->getDownloads($package); |
583 | 583 | $data['favers'] = $this->favoriteManager->getFaverCount($package); |
584 | | - } catch (\RuntimeException|ConnectionException $e) { |
| 584 | + } catch (\RuntimeException|PredisException $e) { |
585 | 585 | $data['downloads'] = null; |
586 | 586 | $data['favers'] = null; |
587 | 587 | } |
@@ -681,7 +681,7 @@ public function viewPackageAction(Request $req, string $name, CsrfTokenManagerIn |
681 | 681 | if ($user) { |
682 | 682 | $data['is_favorite'] = $this->favoriteManager->isMarked($user, $package); |
683 | 683 | } |
684 | | - } catch (\RuntimeException|ConnectionException) { |
| 684 | + } catch (\RuntimeException|PredisException) { |
685 | 685 | } |
686 | 686 |
|
687 | 687 | $data['dependents'] = Killswitch::isEnabled(Killswitch::PAGE_DETAILS_ENABLED) && Killswitch::isEnabled(Killswitch::LINKS_ENABLED) ? $repo->getDependentCount($package->getName()) : 0; |
@@ -799,15 +799,15 @@ public function viewPackageDownloadsAction(Request $req, string $name): Response |
799 | 799 | try { |
800 | 800 | $data['downloads']['total'] = $this->downloadManager->getDownloads($package); |
801 | 801 | $data['favers'] = $this->favoriteManager->getFaverCount($package); |
802 | | - } catch (ConnectionException) { |
| 802 | + } catch (PredisException) { |
803 | 803 | $data['downloads']['total'] = null; |
804 | 804 | $data['favers'] = null; |
805 | 805 | } |
806 | 806 |
|
807 | 807 | foreach ($versions as $version) { |
808 | 808 | try { |
809 | 809 | $data['downloads']['versions'][$version->getVersion()] = $this->downloadManager->getDownloads($package, $version); |
810 | | - } catch (ConnectionException) { |
| 810 | + } catch (PredisException) { |
811 | 811 | $data['downloads']['versions'][$version->getVersion()] = null; |
812 | 812 | } |
813 | 813 | } |
|
0 commit comments