allow next_chapter exception

This commit is contained in:
CakeCN
2025-09-14 14:14:01 +08:00
parent d5b16eec52
commit 06a90b753e

View File

@@ -1,7 +1,11 @@
from flask import current_app
from ..models.function import FunctionResponse
def next_chapter(user_uuid):
ex = current_app.extensions
user_uuid2chatmanager = ex["user_uuid2chatmanager"]
user_uuid2chatmanager[user_uuid].next_chapter()
return "成功进入下一章"
try:
ex = current_app.extensions
user_uuid2chatmanager = ex["user_uuid2chatmanager"]
user_uuid2chatmanager[user_uuid].next_chapter()
return FunctionResponse("next_chapter", True, "成功进入下一章")
except Exception as e:
return FunctionResponse("next_chapter", False, f"进入下一章发生意外错误: {str(e)}")