Skip to content

# `` exceptions

TODO:

Classes:

- `Error` –

  Base class for rdflib exceptions.

- `ParserError` –

  RDF Parser error.

- `UniquenessError` –

  A uniqueness assumption was made in the context, and that is not true

## `` __all__ `module-attribute`

    __all__ = ['Error', 'ParserError', 'UniquenessError']

## `` Error

    Error(msg: Optional[str] = None)

Bases: `Exception`

Base class for rdflib exceptions.

Attributes:

- `msg` –

Source code in `rdflib/exceptions.py`

    20
    21
    22

    def __init__(self, msg: Optional[str] = None):
        Exception.__init__(self, msg)
        self.msg = msg

### `` msg `instance-attribute`

    msg = msg

## `` ParserError

    ParserError(msg: str)

Bases: `Error`

RDF Parser error.

Methods:

- `__str__` –

Attributes:

- `msg` (`str`) –

Source code in `rdflib/exceptions.py`

    28
    29
    30

    def __init__(self, msg: str):
        Error.__init__(self, msg)
        self.msg: str = msg

### `` msg `instance-attribute`

    msg: str = msg

### `` __str__

    __str__() -> str

Source code in `rdflib/exceptions.py`

    32
    33

    def __str__(self) -> str:
        return self.msg

## `` UniquenessError

    UniquenessError(values: Any)

Bases: `Error`

A uniqueness assumption was made in the context, and that is not true

Source code in `rdflib/exceptions.py`

    39
    40
    41
    42
    43
    44
    45

        def __init__(self, values: Any):
            Error.__init__(
                self,
                "\
    Uniqueness assumption is not fulfilled. Multiple values are: %s"
                % values,
            )