diff options
Diffstat (limited to 'rdflib/exceptions.py')
-rw-r--r-- | rdflib/exceptions.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/rdflib/exceptions.py b/rdflib/exceptions.py index 2d71e6e2..708756ef 100644 --- a/rdflib/exceptions.py +++ b/rdflib/exceptions.py @@ -5,13 +5,17 @@ TODO: __all__ = [ "Error", "ParserError", + "UniquenessError", ] +from typing import Any, Optional + + class Error(Exception): """Base class for rdflib exceptions.""" - def __init__(self, msg=None): + def __init__(self, msg: Optional[str] = None): Exception.__init__(self, msg) self.msg = msg @@ -19,18 +23,18 @@ class Error(Exception): class ParserError(Error): """RDF Parser error.""" - def __init__(self, msg): + def __init__(self, msg: str): Error.__init__(self, msg) - self.msg = msg + self.msg: str = msg - def __str__(self): + def __str__(self) -> str: return self.msg class UniquenessError(Error): """A uniqueness assumption was made in the context, and that is not true""" - def __init__(self, values): + def __init__(self, values: Any): Error.__init__( self, "\ |