summaryrefslogtreecommitdiff
path: root/rdflib/exceptions.py
blob: 2d71e6e2e02ab777659f83003876c37dd2d62c34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
TODO:
"""

__all__ = [
    "Error",
    "ParserError",
]


class Error(Exception):
    """Base class for rdflib exceptions."""

    def __init__(self, msg=None):
        Exception.__init__(self, msg)
        self.msg = msg


class ParserError(Error):
    """RDF Parser error."""

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

    def __str__(self):
        return self.msg


class UniquenessError(Error):
    """A uniqueness assumption was made in the context, and that is not true"""

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