总线通信架构整改完成

This commit is contained in:
2025-09-27 19:03:05 +08:00
parent c7c0d15545
commit 1c47497fc2
272 changed files with 592 additions and 304 deletions

View File

@@ -1,14 +1,19 @@
from functools import wraps
from codes.common import db_operation
from inspect import getfile
from pathlib import Path
def handle_exception(module, stop: bool = False):
def handle_exception(stop: bool = False):
def exceptions(func):
module = Path(getfile(func)).stem
func_name = func.__name__
@wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
db_operation.db_write_logs(e, module, "exception")
db_operation.db_write_logs(str(e), "@".join([func_name, module]), "exception")
if stop:
raise e
return wrapper