exceptions.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. """GraphDB exceptions."""
  2. import rdflib.contrib.rdf4j.exceptions as rdf4j_exceptions
  3. class GraphDBError(Exception):
  4. """Base class for GraphDB exceptions."""
  5. class ResponseFormatError(GraphDBError):
  6. """Raised when the response format is invalid."""
  7. class RepositoryNotHealthyError(
  8. GraphDBError, rdf4j_exceptions.RepositoryNotHealthyError
  9. ):
  10. """Raised when the repository is not healthy."""
  11. class RepositoryNotFoundError(GraphDBError, rdf4j_exceptions.RepositoryNotFoundError):
  12. """Raised when the repository is not found."""
  13. class BadRequestError(GraphDBError):
  14. """Raised when the request is invalid."""
  15. class UnauthorisedError(GraphDBError):
  16. """Raised when the user is unauthorised."""
  17. class ForbiddenError(GraphDBError):
  18. """Raised when the user is forbidden."""
  19. class NotFoundError(GraphDBError):
  20. """Raised when the resource is not found."""
  21. class ConflictError(GraphDBError):
  22. """Raised when the request conflicts with the current state of the server."""
  23. class PreconditionFailedError(GraphDBError):
  24. """Raised when the precondition is failed."""
  25. class InternalServerError(GraphDBError):
  26. """Raised when the server returns an internal server error."""
  27. class ServiceUnavailableError(GraphDBError):
  28. """Raised when the server is unavailable."""