Skip to main content

Error Handling

Conversational Graph raises specific exceptions for different failure scenarios - invalid topology, runtime errors, checkpoint issues, and more. All exceptions derive from a common GraphError base class, so you can catch them broadly or handle each type individually.

from videosdk.conversational_graph import GraphError

try:
await graph.resume_with_human_input({"name": "John"})
except GraphError as e:
print(f"Graph error: {e}")

The table below lists every exception type and the condition that triggers it.

ExceptionWhen It Is Raised
GraphNotCompiledErrorMethod called before compile()
GraphAlreadyEndedErrorInput sent after graph terminated
GraphPausedErrorOperation requires running graph, but paused
GraphResumeErrorresume_with_human_input() on non-paused graph
GraphRecursionErrorNode depth exceeds 10
GraphValidationErrorTopology validation fails
NodeNotFoundErrorReferenced node doesn't exist
NodeExecutionErrorUnhandled exception in node function
InvalidTransitionErrordecide() returns key not in mapping
CheckpointNotFoundErrorCheckpoint ID doesn't exist
CheckpointReplayErrorReplay without checkpointer configured
CheckpointBackendErrorBackend HTTP/DB error

Got a Question? Ask us on discord