fix(emoji_manager): 添加异常处理以记录删除数据库记录时的错误信息,确保在出错时返回0而不是抛出异常(同时在主程序加载的时候也不会笑笑boom了)
This commit is contained in:
@@ -211,6 +211,9 @@ class MaiEmoji:
|
||||
result = 0 # Indicate no DB record was deleted
|
||||
else:
|
||||
result = will_delete_emoji.delete_instance() # Returns the number of rows deleted.
|
||||
except Exception as e:
|
||||
logger.error(f"[错误] 删除数据库记录时出错: {str(e)}")
|
||||
result = 0
|
||||
|
||||
if result > 0:
|
||||
logger.info(f"[删除] 表情包数据库记录 {self.filename} (Hash: {self.hash})")
|
||||
|
||||
Reference in New Issue
Block a user