Skip to content

Commit 6feb5a3

Browse files
authored
[Bug][Installer] Don't silently catch errors during install (#695)
1 parent 4302013 commit 6feb5a3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Installer.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Pimcore\Bundle\DataHubBundle\Controller\ConfigController;
2020
use Pimcore\Bundle\DataHubBundle\Migrations\PimcoreX\Version20210305134111;
2121
use Pimcore\Db;
22+
use Pimcore\Extension\Bundle\Installer\Exception\InstallationException;
2223
use Pimcore\Extension\Bundle\Installer\SettingsStoreAwareInstaller;
2324
use Pimcore\Logger;
2425
use Pimcore\Model\Tool\SettingsStore;
@@ -40,12 +41,12 @@ public function needsReloadAfterInstall(): bool
4041
*/
4142
public function install()
4243
{
43-
// create backend permission
44-
Definition::create(ConfigController::CONFIG_NAME)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
45-
Definition::create(self::DATAHUB_ADAPTER_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
46-
Definition::create(self::DATAHUB_ADMIN_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
47-
4844
try {
45+
// create backend permission
46+
Definition::create(ConfigController::CONFIG_NAME)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
47+
Definition::create(self::DATAHUB_ADAPTER_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
48+
Definition::create(self::DATAHUB_ADMIN_PERMISSION)->setCategory(self::DATAHUB_PERMISSION_CATEGORY)->save();
49+
4950
$types = ['document', 'asset', 'object'];
5051

5152
$db = Db::get();
@@ -68,11 +69,10 @@ public function install()
6869
}
6970
} catch (\Exception $e) {
7071
Logger::warn($e);
72+
throw new InstallationException($e->getMessage());
7173
}
7274

7375
parent::install();
74-
75-
return true;
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)