Эх сурвалжийг харах

refactor(sixshop-filesystem): 优化 FilesystemHook 中的异常处理

- 使用 throw_logic_exception函数替代 Helper::throw_logic_exception 方法
- 引入 throw_logic_exception 函数以支持异常抛出
runphp 6 сар өмнө
parent
commit
92f3847093

+ 3 - 1
src/Hook/FilesystemHook.php

@@ -10,6 +10,8 @@ use SixShop\Filesystem\Model\FilesystemFileModel;
 use think\App;
 use think\exception\ErrorException;
 
+use function SixShop\Core\throw_logic_exception;
+
 class FilesystemHook
 {
     private bool $configInit = false;
@@ -56,7 +58,7 @@ class FilesystemHook
                     ], 'filesystem');
                     $this->configInit = true;
                 } catch (ErrorException $e) {
-                    Helper::throw_logic_exception('filesystem配置错误');
+                    throw_logic_exception('filesystem配置错误');
                 }
                 return $app->config->get($name);
             }