Exceptions
Custom exception classes for graph operations in PyAgenity.
This package provides
- GraphError: Base exception for graph-related errors.
- NodeError: Exception for node-specific errors.
- GraphRecursionError: Exception for recursion limit errors in graphs.
Modules:
Name | Description |
---|---|
graph_error |
|
node_error |
|
recursion_error |
|
storage_exceptions |
Structured exception taxonomy for persistence & runtime layers. |
Classes:
Name | Description |
---|---|
GraphError |
Base exception for graph-related errors. |
GraphRecursionError |
Exception raised when graph execution exceeds the recursion limit. |
NodeError |
Exception raised when a node encounters an error. |
Attributes¶
Classes¶
GraphError
¶
Bases: Exception
Base exception for graph-related errors.
This exception is raised when an error related to graph operations occurs.
Example
from pyagenity.exceptions.graph_error import GraphError raise GraphError("Invalid graph structure")
Methods:
Name | Description |
---|---|
__init__ |
Initializes a GraphError with the given message. |
Source code in pyagenity/exceptions/graph_error.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Functions¶
__init__
¶
__init__(message)
Initializes a GraphError with the given message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Description of the error. |
required |
Source code in pyagenity/exceptions/graph_error.py
18 19 20 21 22 23 24 25 26 |
|
GraphRecursionError
¶
Bases: GraphError
Exception raised when graph execution exceeds the recursion limit.
This exception is used to indicate that a graph operation has recursed too deeply.
Example
from pyagenity.exceptions.recursion_error import GraphRecursionError raise GraphRecursionError("Recursion limit exceeded in graph execution")
Methods:
Name | Description |
---|---|
__init__ |
Initializes a GraphRecursionError with the given message. |
Source code in pyagenity/exceptions/recursion_error.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Functions¶
__init__
¶
__init__(message)
Initializes a GraphRecursionError with the given message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Description of the recursion error. |
required |
Source code in pyagenity/exceptions/recursion_error.py
20 21 22 23 24 25 26 27 28 |
|
NodeError
¶
Bases: GraphError
Exception raised when a node encounters an error.
This exception is used for errors specific to nodes within a graph.
Example
from pyagenity.exceptions.node_error import NodeError raise NodeError("Node failed to execute")
Methods:
Name | Description |
---|---|
__init__ |
Initializes a NodeError with the given message. |
Source code in pyagenity/exceptions/node_error.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Functions¶
__init__
¶
__init__(message)
Initializes a NodeError with the given message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Description of the node error. |
required |
Source code in pyagenity/exceptions/node_error.py
20 21 22 23 24 25 26 27 28 |
|
Modules¶
graph_error
¶
Classes:
Name | Description |
---|---|
GraphError |
Base exception for graph-related errors. |
Attributes:
Name | Type | Description |
---|---|---|
logger |
|
Attributes¶
Classes¶
GraphError
¶
Bases: Exception
Base exception for graph-related errors.
This exception is raised when an error related to graph operations occurs.
Example
from pyagenity.exceptions.graph_error import GraphError raise GraphError("Invalid graph structure")
Methods:
Name | Description |
---|---|
__init__ |
Initializes a GraphError with the given message. |
Source code in pyagenity/exceptions/graph_error.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Functions¶
__init__
¶__init__(message)
Initializes a GraphError with the given message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
¶ |
str
|
Description of the error. |
required |
Source code in pyagenity/exceptions/graph_error.py
18 19 20 21 22 23 24 25 26 |
|
node_error
¶
Classes:
Name | Description |
---|---|
NodeError |
Exception raised when a node encounters an error. |
Attributes:
Name | Type | Description |
---|---|---|
logger |
|
Attributes¶
Classes¶
NodeError
¶
Bases: GraphError
Exception raised when a node encounters an error.
This exception is used for errors specific to nodes within a graph.
Example
from pyagenity.exceptions.node_error import NodeError raise NodeError("Node failed to execute")
Methods:
Name | Description |
---|---|
__init__ |
Initializes a NodeError with the given message. |
Source code in pyagenity/exceptions/node_error.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Functions¶
__init__
¶__init__(message)
Initializes a NodeError with the given message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
¶ |
str
|
Description of the node error. |
required |
Source code in pyagenity/exceptions/node_error.py
20 21 22 23 24 25 26 27 28 |
|
recursion_error
¶
Classes:
Name | Description |
---|---|
GraphRecursionError |
Exception raised when graph execution exceeds the recursion limit. |
Attributes:
Name | Type | Description |
---|---|---|
logger |
|
Attributes¶
Classes¶
GraphRecursionError
¶
Bases: GraphError
Exception raised when graph execution exceeds the recursion limit.
This exception is used to indicate that a graph operation has recursed too deeply.
Example
from pyagenity.exceptions.recursion_error import GraphRecursionError raise GraphRecursionError("Recursion limit exceeded in graph execution")
Methods:
Name | Description |
---|---|
__init__ |
Initializes a GraphRecursionError with the given message. |
Source code in pyagenity/exceptions/recursion_error.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
Functions¶
__init__
¶__init__(message)
Initializes a GraphRecursionError with the given message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
¶ |
str
|
Description of the recursion error. |
required |
Source code in pyagenity/exceptions/recursion_error.py
20 21 22 23 24 25 26 27 28 |
|
storage_exceptions
¶
Structured exception taxonomy for persistence & runtime layers.
These exceptions let higher-level orchestration decide retry / fail-fast logic
instead of relying on broad except Exception
blocks.
Classes:
Name | Description |
---|---|
MetricsError |
Raised when metrics emission fails (should normally be swallowed/logged). |
SchemaVersionError |
Raised when schema version detection or migration application fails. |
SerializationError |
Raised when (de)serialization of state/messages fails deterministically. |
StorageError |
Base class for non-retryable storage layer errors. |
TransientStorageError |
Retryable storage error (connection drops, timeouts). |
Classes¶
MetricsError
¶
Bases: Exception
Raised when metrics emission fails (should normally be swallowed/logged).
Source code in pyagenity/exceptions/storage_exceptions.py
26 27 |
|
SchemaVersionError
¶
Bases: StorageError
Raised when schema version detection or migration application fails.
Source code in pyagenity/exceptions/storage_exceptions.py
22 23 |
|
SerializationError
¶
Bases: StorageError
Raised when (de)serialization of state/messages fails deterministically.
Source code in pyagenity/exceptions/storage_exceptions.py
18 19 |
|
StorageError
¶
Bases: Exception
Base class for non-retryable storage layer errors.
Source code in pyagenity/exceptions/storage_exceptions.py
10 11 |
|
TransientStorageError
¶
Bases: StorageError
Retryable storage error (connection drops, timeouts).
Source code in pyagenity/exceptions/storage_exceptions.py
14 15 |
|