Skip to content

Commit

Permalink
[Bug][Installer] Don't silently catch errors during install (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 authored Feb 15, 2023
1 parent 4302013 commit 6feb5a3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Pimcore\Bundle\DataHubBundle\Controller\ConfigController;
use Pimcore\Bundle\DataHubBundle\Migrations\PimcoreX\Version20210305134111;
use Pimcore\Db;
use Pimcore\Extension\Bundle\Installer\Exception\InstallationException;
use Pimcore\Extension\Bundle\Installer\SettingsStoreAwareInstaller;
use Pimcore\Logger;
use Pimcore\Model\Tool\SettingsStore;
Expand All @@ -40,12 +41,12 @@ public function needsReloadAfterInstall(): bool
*/
public function install()
{
// create backend permission
Definition::create(ConfigController::CONFIG_NAME)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
Definition::create(self::DATAHUB_ADAPTER_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
Definition::create(self::DATAHUB_ADMIN_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();

try {
// create backend permission
Definition::create(ConfigController::CONFIG_NAME)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
Definition::create(self::DATAHUB_ADAPTER_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
Definition::create(self::DATAHUB_ADMIN_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();

$types = ['document', 'asset', 'object'];

$db = Db::get();
Expand All @@ -68,11 +69,10 @@ public function install()
}
} catch (\Exception $e) {
Logger::warn($e);
throw new InstallationException($e->getMessage());
}

parent::install();

return true;
}

/**
Expand Down

0 comments on commit 6feb5a3

Please sign in to comment.