Skip to content

Instantly share code, notes, and snippets.

@samirsaci
Created November 9, 2025 13:02
Show Gist options
  • Select an option

  • Save samirsaci/56d8f4d157d346a89e0c49d4a7fda6ce to your computer and use it in GitHub Desktop.

Select an option

Save samirsaci/56d8f4d157d346a89e0c49d4a7fda6ce to your computer and use it in GitHub Desktop.
AI Agent Budget Planning - Node Functions Error
async def handle_error(state: AgentState) -> AgentState:
err = state.get("error", "Unknown error")
logger.error(f"[BudgetGraph] handle_error: {err}")
html = (
"<b>Budget Summary</b><br>"
"<ul><li>There was an error while processing your request.</li></ul>"
f"<b>Details</b><br>{err}"
)
return {"html_summary": html}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment