Coverage for src / sparqlite / exceptions.py: 100%
7 statements
« prev ^ index » next coverage.py v7.12.0, created at 2025-12-20 08:07 +0000
« prev ^ index » next coverage.py v7.12.0, created at 2025-12-20 08:07 +0000
1"""Custom exceptions for sparqlite."""
3from typing import Optional
6class SPARQLError(Exception):
7 """Base exception for all SPARQL-related errors."""
10class QueryError(SPARQLError):
11 """Raised when there is a syntax error in the SPARQL query."""
14class EndpointError(SPARQLError):
15 """Raised when there is an HTTP or connection error with the endpoint."""
17 def __init__(self, message: str, status_code: Optional[int] = None):
18 super().__init__(message)
19 self.status_code = status_code