|
@@ -6,10 +6,11 @@ import sys
|
|
|
from types import ModuleType
|
|
from types import ModuleType
|
|
|
from werkzeug.exceptions import HTTPException
|
|
from werkzeug.exceptions import HTTPException
|
|
|
|
|
|
|
|
-from ruoyi_common.base.serializer import JsonProvider,handle_http_exception
|
|
|
|
|
|
|
+from ruoyi_common.base.serializer import JsonProvider,handle_http_exception,handle_util_exception
|
|
|
from ruoyi_common.descriptor.listener import ModuleSignalListener
|
|
from ruoyi_common.descriptor.listener import ModuleSignalListener
|
|
|
from ruoyi_common.base.signal import module_initailize
|
|
from ruoyi_common.base.signal import module_initailize
|
|
|
from ruoyi_common.ruoyi.registry import RuoYiModuleRegistry
|
|
from ruoyi_common.ruoyi.registry import RuoYiModuleRegistry
|
|
|
|
|
+from ruoyi_common.utils.base import UtilException
|
|
|
|
|
|
|
|
|
|
|
|
|
@ModuleSignalListener(sys.modules[__name__],module_initailize)
|
|
@ModuleSignalListener(sys.modules[__name__],module_initailize)
|
|
@@ -31,3 +32,6 @@ def import_hook(module:ModuleType, registry:RuoYiModuleRegistry):
|
|
|
registry.app.register_error_handler(
|
|
registry.app.register_error_handler(
|
|
|
HTTPException, handle_http_exception
|
|
HTTPException, handle_http_exception
|
|
|
)
|
|
)
|
|
|
|
|
+ registry.app.register_error_handler(
|
|
|
|
|
+ UtilException, handle_util_exception
|
|
|
|
|
+ )
|