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.
| Exception | When It Is Raised |
|---|---|
GraphNotCompiledError | Method called before compile() |
GraphAlreadyEndedError | Input sent after graph terminated |
GraphPausedError | Operation requires running graph, but paused |
GraphResumeError | resume_with_human_input() on non-paused graph |
GraphRecursionError | Node depth exceeds 10 |
GraphValidationError | Topology validation fails |
NodeNotFoundError | Referenced node doesn't exist |
NodeExecutionError | Unhandled exception in node function |
InvalidTransitionError | decide() returns key not in mapping |
CheckpointNotFoundError | Checkpoint ID doesn't exist |
CheckpointReplayError | Replay without checkpointer configured |
CheckpointBackendError | Backend HTTP/DB error |
Got a Question? Ask us on discord