Skip to content

Commit

Permalink
Manage error while cache loading and database not set
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Sep 3, 2024
1 parent 30951d0 commit 5b0ccda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Kernel/SyliusNoCommerceKernelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace MonsieurBiz\SyliusNoCommercePlugin\Kernel;

use Exception;
use MonsieurBiz\SyliusNoCommercePlugin\Model\Config;
use MonsieurBiz\SyliusNoCommercePlugin\Model\ConfigInterface;
use MonsieurBiz\SyliusNoCommercePlugin\Provider\FeaturesProviderInterface;
Expand Down Expand Up @@ -84,7 +85,12 @@ public function getRoutesToRemove(): array
// Loop on settings to add routes
/** @var FeaturesProviderInterface $featuresProvider */
$featuresProvider = $this->container->get('monsieurbiz.no_commerce.provider.features_provider');
$routesToEnable = $featuresProvider->getRoutesToEnable();

try {
$routesToEnable = $featuresProvider->getRoutesToEnable();
} catch (Exception $e) {
$routesToEnable = [];
}

foreach ($routesToEnable as $route) {
$this->enableRoute($route);
Expand Down

0 comments on commit 5b0ccda

Please sign in to comment.