feat:系统错误时发出事件

This commit is contained in:
jxxghp
2024-05-29 16:28:17 +08:00
parent 4c5366f8b4
commit 74980911fe
4 changed files with 34 additions and 0 deletions

View File

@ -224,6 +224,16 @@ class Command(metaclass=Singleton):
self.messagehelper.put(title=f"{event.event_type} 事件处理出错",
message=f"{class_name}.{method_name}{str(e)}",
role="system")
self.eventmanager.send_event(
EventType.SystemError,
{
"type": "event",
"event_type": event.event_type,
"event_handle": f"{class_name}.{method_name}",
"error": str(e),
"traceback": traceback.format_exc()
}
)
def __run_command(self, command: Dict[str, any],
data_str: str = "",