Coverage for src/qdrant_loader/connectors/exceptions.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-04 05:50 +0000

1class ConnectorError(Exception): 

2 """Base exception for connector errors.""" 

3 

4 

5class ConnectorNotInitializedError(ConnectorError): 

6 """Raised when the connector is not properly initialized.""" 

7 

8 

9class DocumentProcessingError(ConnectorError): 

10 """Raised when there is an error processing a document.""" 

11 

12 

13class HTTPRequestError(ConnectorError): 

14 """Raised when there is an error with HTTP requests.""" 

15 

16 def __init__( 

17 self, url: str, status_code: int | None = None, message: str | None = None 

18 ): 

19 self.url = url 

20 self.status_code = status_code 

21 self.message = message 

22 super().__init__(f"HTTP request failed for {url}: {message or 'Unknown error'}")