Source code

Download source archive ↓

src/rdflib/contrib/graphdb/exceptions.py

1"""GraphDB exceptions."""
2
3import rdflib.contrib.rdf4j.exceptions as rdf4j_exceptions
4
5
6class GraphDBError(Exception):
7    """Base class for GraphDB exceptions."""
8
9
10class ResponseFormatError(GraphDBError):
11    """Raised when the response format is invalid."""
12
13
14class RepositoryNotHealthyError(
15    GraphDBError, rdf4j_exceptions.RepositoryNotHealthyError
16):
17    """Raised when the repository is not healthy."""
18
19
20class RepositoryNotFoundError(GraphDBError, rdf4j_exceptions.RepositoryNotFoundError):
21    """Raised when the repository is not found."""
22
23
24class BadRequestError(GraphDBError):
25    """Raised when the request is invalid."""
26
27
28class UnauthorisedError(GraphDBError):
29    """Raised when the user is unauthorised."""
30
31
32class ForbiddenError(GraphDBError):
33    """Raised when the user is forbidden."""
34
35
36class NotFoundError(GraphDBError):
37    """Raised when the resource is not found."""
38
39
40class ConflictError(GraphDBError):
41    """Raised when the request conflicts with the current state of the server."""
42
43
44class PreconditionFailedError(GraphDBError):
45    """Raised when the precondition is failed."""
46
47
48class InternalServerError(GraphDBError):
49    """Raised when the server returns an internal server error."""
50
51
52class ServiceUnavailableError(GraphDBError):
53    """Raised when the server is unavailable."""