chore: 捕获安装异常

This commit is contained in:
JaguarJack 2023-02-26 19:15:47 +08:00
parent 78f9728ae3
commit 5ddfb0b5aa

View File

@ -46,9 +46,15 @@ class ModuleInstall
*/ */
protected function installWithTitle(string $title): void protected function installWithTitle(string $title): void
{ {
try {
$installer = CatchAdmin::getModuleInstaller($title); $installer = CatchAdmin::getModuleInstaller($title);
$installer->install(); $installer->install();
} catch (\Exception|\Throwable $e) {
CatchAdmin::deleteModulePath($title);
throw new FailedException('安装失败: ' . $e->getMessage());
}
} }
/** /**