Exceptions

This module contains functionality related to the the exceptions module for embedding.vector_stores.core.

Exceptions

CollectionExistsException

Bases: Exception

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

This exception helps prevent accidental overwriting of existing collections and provides clear error messaging about the conflicting collection name.

Source code in src/embedding/vector_stores/core/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.

    This exception helps prevent accidental overwriting of existing collections
    and provides clear error messaging about the conflicting collection name.
    """

    def __init__(self, collection_name: str) -> None:
        """Initialize the CollectionExistsException with the conflicting collection name.

        Args:
            collection_name: Name of the collection that already exists in the vector store.
                            This name caused the creation attempt to fail.
        """
        self.collection_name = collection_name
        self.message = f"Collection with name {collection_name} already exists"
        super().__init__(self.message)

__init__(collection_name)

Initialize the CollectionExistsException with the conflicting collection name.

Parameters:
  • collection_name (str) –

    Name of the collection that already exists in the vector store. This name caused the creation attempt to fail.

Source code in src/embedding/vector_stores/core/exceptions.py
 8
 9
10
11
12
13
14
15
16
17
def __init__(self, collection_name: str) -> None:
    """Initialize the CollectionExistsException with the conflicting collection name.

    Args:
        collection_name: Name of the collection that already exists in the vector store.
                        This name caused the creation attempt to fail.
    """
    self.collection_name = collection_name
    self.message = f"Collection with name {collection_name} already exists"
    super().__init__(self.message)