Skip to content

Graph error

Classes:

Name Description
GraphError

Base exception for graph-related errors.

Attributes:

Name Type Description
logger

Attributes

logger module-attribute

logger = getLogger(__name__)

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

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

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

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

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