diff --git a/catch/CatchAdminService.php b/catch/CatchAdminService.php index cf4db93..28b5c4b 100644 --- a/catch/CatchAdminService.php +++ b/catch/CatchAdminService.php @@ -6,6 +6,7 @@ use catchAdmin\permissions\OperateLogListener; use catchAdmin\permissions\PermissionsMiddleware; use catchAdmin\system\event\LoginLogEvent; use catchAdmin\system\event\OperateLogEvent; +use catcher\CatchExceptionHandle; use catcher\CatchQuery; use catcher\command\BackupCommand; use catcher\command\CompressPackageCommand; @@ -20,6 +21,7 @@ use catcher\command\SeedRunCommand; use catcher\command\worker\WsWorkerCommand; use catcher\event\LoadModuleRoutes; use catcher\validates\Sometimes; +use think\exception\Handle; use think\facade\Validate; use think\Service; @@ -49,6 +51,7 @@ class CatchAdminService extends Service $this->registerMiddleWares(); $this->registerListeners(); $this->registerQuery(); + $this->registerExceptionHandle(); } /** @@ -132,4 +135,9 @@ class CatchAdminService extends Service 'connections' => $connections ], 'database'); } + + protected function registerExceptionHandle() + { + $this->app->bind(Handle::class, CatchExceptionHandle::class); + } }