fix(research): show exception type when error message is empty
Some exceptions (e.g. connection errors) produce empty str(e), resulting in "Research failed: " with no explanation. Fall back to the exception class name when the message is blank. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -376,8 +376,9 @@ async def run_generation(
|
|||||||
buf.content_so_far += done_text
|
buf.content_so_far += done_text
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception("Research pipeline failed for topic: %s", topic)
|
logger.exception("Research pipeline failed for topic: %s", topic)
|
||||||
result = {"success": False, "error": str(e)}
|
err_msg = str(e) or f"{type(e).__name__}: unexpected error"
|
||||||
err_text = f"\nResearch failed: {e}"
|
result = {"success": False, "error": err_msg}
|
||||||
|
err_text = f"\nResearch failed: {err_msg}"
|
||||||
buf.append_event("chunk", {"chunk": err_text})
|
buf.append_event("chunk", {"chunk": err_text})
|
||||||
buf.content_so_far += err_text
|
buf.content_so_far += err_text
|
||||||
research_completed = True
|
research_completed = True
|
||||||
|
|||||||
Reference in New Issue
Block a user