Source code for rdf4j_python.exception.repo_exception

[docs] class Rdf4jError(Exception): """Base exception for all RDF4J SDK errors. All exceptions raised by the RDF4J Python SDK inherit from this class, allowing users to catch all SDK-related errors with a single except clause. Example: try: await repo.query("SELECT * WHERE { ?s ?p ?o }") except Rdf4jError as e: # Catches any RDF4J SDK error print(f"RDF4J error: {e}") """
[docs] class RepositoryError(Rdf4jError): """Base exception for repository-related errors."""
[docs] class RepositoryCreationException(RepositoryError): """Exception raised when a repository creation fails."""
[docs] class RepositoryDeletionException(RepositoryError): """Exception raised when a repository deletion fails."""
[docs] class RepositoryNotFoundException(RepositoryError): """Exception raised when a repository is not found."""
[docs] class RepositoryInternalException(RepositoryError): """Exception raised when a repository internal error occurs."""
[docs] class RepositoryUpdateException(RepositoryError): """Exception raised when a repository update fails."""
[docs] class NamespaceException(Rdf4jError): """Exception raised when a namespace operation fails."""
[docs] class NetworkError(Rdf4jError): """Exception raised when a network/connection error occurs."""
[docs] class QueryError(Rdf4jError): """Exception raised when a SPARQL query is invalid or fails."""
[docs] class TransactionError(Rdf4jError): """Base exception for transaction-related errors."""
[docs] class TransactionStateError(TransactionError): """Exception raised when a transaction operation is invalid for the current state. For example, trying to commit an already committed transaction, or trying to add statements to a closed transaction. """