From 5ddfb0b5aa5b7738b9ce1f401d3630301eed12f5 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sun, 26 Feb 2023 19:15:47 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8D=95=E8=8E=B7=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/Develop/Support/ModuleInstall.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/Develop/Support/ModuleInstall.php b/modules/Develop/Support/ModuleInstall.php index 0d47ab4..8ad99bd 100644 --- a/modules/Develop/Support/ModuleInstall.php +++ b/modules/Develop/Support/ModuleInstall.php @@ -46,9 +46,15 @@ class ModuleInstall */ protected function installWithTitle(string $title): void { - $installer = CatchAdmin::getModuleInstaller($title); + try { + $installer = CatchAdmin::getModuleInstaller($title); - $installer->install(); + $installer->install(); + } catch (\Exception|\Throwable $e) { + CatchAdmin::deleteModulePath($title); + + throw new FailedException('安装失败: ' . $e->getMessage()); + } } /**