Source code in pydantic_graph/pydantic_graph/exceptions.py
7 8 9101112131415
classGraphSetupError(TypeError):"""Error caused by an incorrectly configured graph."""message:str"""Description of the mistake."""def__init__(self,message:str):self.message=messagesuper().__init__(message)
Source code in pydantic_graph/pydantic_graph/exceptions.py
181920212223242526
classGraphRuntimeError(RuntimeError):"""Error caused by an issue during graph execution."""message:str"""The error message."""def__init__(self,message:str):self.message=messagesuper().__init__(message)
Error caused by trying to run a node that already has status 'running', 'success', or 'error'.
Source code in pydantic_graph/pydantic_graph/exceptions.py
293031323334353637383940
classGraphNodeStatusError(GraphRuntimeError):"""Error caused by trying to run a node that already has status `'running'`, `'success'`, or `'error'`."""def__init__(self,actual_status:'SnapshotStatus'):self.actual_status=actual_statussuper().__init__(f"Incorrect snapshot status {actual_status!r}, must be 'created' or 'pending'.")@classmethoddefcheck(cls,status:'SnapshotStatus')->None:"""Check if the status is valid."""ifstatusnotin{'created','pending'}:raisecls(status)