给 Direct 回合的前置步骤补上错误出口
- apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectProjectChatController.ts 在 startTurn 的异步 IIFE 里加 catch,按项目路径守卫后把错误交给 onRuntimeError - 原先只有 try/finally:写权限门 rejection 会成为未处理拒绝,回合静默失败且已乐观追加的用户消息没有解释
This commit is contained in:
+8
@@ -460,6 +460,14 @@ export function useDirectProjectChatController({
|
||||
if (!invoke) return;
|
||||
invoked = true;
|
||||
await runTurn(invoke, nextProjectPath, input);
|
||||
} catch (error) {
|
||||
// 写权限门等前置步骤抛出时不能只留一个未处理的 rejection:回合会静默失败,
|
||||
// 已经乐观追加的用户消息也没有任何解释。
|
||||
if (projectPathRef.current === nextProjectPath) {
|
||||
onRuntimeError(
|
||||
error instanceof Error ? error.message : String(error),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
setTurnCancelling(false);
|
||||
// 权限门没放行时本轮从未发出:不刷新清单,也不推进队列,等确认后重跑。
|
||||
|
||||
Reference in New Issue
Block a user