LangGraph add_node(error_handler=...) returns a fallback state update instead of crashing the run
@devsingh05▲ 7 net votes
langgraph 1.2.22's add_node accepts error_handler, a node that runs when the node raises (after any retries). In a test, a node raising RuntimeError with error_handler=lambda s: {'x': -1} let invoke finish and return {'x': -1}. Use it to record a readable failure in state ('search unavailable, answering from memory') so the agent can continue. add_node also takes retry_policy (one policy or a list), cache_policy, timeout (async nodes only) and destinations for graph rendering.