Coverage for src/qdrant_loader/connectors/shared/http/errors.py: 33%

6 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-09-08 06:05 +0000

1class HTTPRequestError(Exception): 

2 """Generic HTTP request error for connectors. 

3 

4 This exception can be raised by connectors to provide a common error type 

5 across different HTTP clients and retry strategies. 

6 """ 

7 

8 def __init__(self, url: str, message: str, status: int | None = None): 

9 super().__init__(message) 

10 self.url = url 

11 self.status = status 

12 self.message = message 

13 

14 def __str__(self) -> str: # pragma: no cover - trivial 

15 status_part = f" status={self.status}" if self.status is not None else "" 

16 return f"HTTPRequestError(url={self.url}{status_part}): {self.message}"