Skip to content

Node error

Classes:

Name Description
NodeError

Exception raised when a node encounters an error.

Attributes:

Name Type Description
logger

Attributes

logger module-attribute

logger = getLogger(__name__)

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
class NodeError(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")
    """

    def __init__(self, message: str):
        """
        Initializes a NodeError with the given message.

        Args:
            message (str): Description of the node error.
        """
        logger.error("NodeError raised: %s", message)
        super().__init__(message)

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
def __init__(self, message: str):
    """
    Initializes a NodeError with the given message.

    Args:
        message (str): Description of the node error.
    """
    logger.error("NodeError raised: %s", message)
    super().__init__(message)