Exceptions

This module contains functionality related to the the exceptions module for common.

Exceptions

CollectionExistsException

Bases: Exception

Exception raised when attempting to create a vector store collection that already exists.

Attributes:
  • collection_name

    Name of the existing collection.

  • message

    Explanation of the error.

Source code in src/common/exceptions.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
class CollectionExistsException(Exception):
    """Exception raised when attempting to create a vector store collection that already exists.

    Attributes:
        collection_name: Name of the existing collection.
        message: Explanation of the error.
    """

    def __init__(self, collection_name: str) -> None:
        """Initialize the exception.

        Args:
            collection_name: Name of the collection that already exists.
        """
        self.collection_name = collection_name
        self.message = f"Collection with name {collection_name} already exists"
        super().__init__(self.message)

__init__(collection_name)

Initialize the exception.

Parameters:
  • collection_name (str) –

    Name of the collection that already exists.

Source code in src/common/exceptions.py
 9
10
11
12
13
14
15
16
17
def __init__(self, collection_name: str) -> None:
    """Initialize the exception.

    Args:
        collection_name: Name of the collection that already exists.
    """
    self.collection_name = collection_name
    self.message = f"Collection with name {collection_name} already exists"
    super().__init__(self.message)

TraceNotFoundException

Bases: Exception

Exception raised when a trace for a given message ID cannot be found.

Attributes:
  • message_id

    ID of the message whose trace was not found.

  • message

    Explanation of the error.

Source code in src/common/exceptions.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class TraceNotFoundException(Exception):
    """Exception raised when a trace for a given message ID cannot be found.

    Attributes:
        message_id: ID of the message whose trace was not found.
        message: Explanation of the error.
    """

    def __init__(self, message_id: str) -> None:
        """Initialize the exception.

        Args:
            message_id: ID of the message whose trace was not found.
        """
        self.message_id = message_id
        self.message = f"Trace for message with id {message_id} not found"
        super().__init__(self.message)

__init__(message_id)

Initialize the exception.

Parameters:
  • message_id (str) –

    ID of the message whose trace was not found.

Source code in src/common/exceptions.py
28
29
30
31
32
33
34
35
36
def __init__(self, message_id: str) -> None:
    """Initialize the exception.

    Args:
        message_id: ID of the message whose trace was not found.
    """
    self.message_id = message_id
    self.message = f"Trace for message with id {message_id} not found"
    super().__init__(self.message)