fix(FN-920): improve error handling in subtask breakdown SSE stream
- Handle empty error messages in subtask-breakdown session by falling back to 'Unknown error' - Fix backend SSE routes to coerce error data to string and handle missing message - Improve frontend connectSubtaskStream to validate parsed error data before displaying - Add tests for error display in SubtaskBreakdownModal component
This commit is contained in:
@@ -195,7 +195,7 @@ export async function createSubtaskSession(initialDescription: string, _store?:
|
||||
const existing = sessions.get(sessionId);
|
||||
if (!existing) return;
|
||||
existing.status = "error";
|
||||
existing.error = err instanceof Error ? err.message : "Failed to generate subtasks";
|
||||
existing.error = err instanceof Error ? (err.message || "Unknown error") : "Failed to generate subtasks";
|
||||
existing.updatedAt = new Date();
|
||||
persistSubtaskSession(existing, "error", existing.error);
|
||||
subtaskStreamManager.broadcast(sessionId, { type: "error", data: existing.error });
|
||||
|
||||
Reference in New Issue
Block a user