Skip to content

DuplicateIndexError

Bases: IndexError

Exception raised for trying to add an element with an index that does already exist in the underlying data.

Parameters:

Name Type Description Default
index int

The wrongly added index.

required
Source code in src/safeds/exceptions/_data.py
class DuplicateIndexError(IndexError):
    """
    Exception raised for trying to add an element with an index that does already exist in the underlying data.

    Parameters
    ----------
    index:
        The wrongly added index.
    """

    def __init__(self, index: int):
        super().__init__(f"The index '{index}' is already in use.")