mirror of
https://github.com/qdrant/qdrant-client.git
synced 2026-07-26 04:31:03 -05:00
* Update grpc client * Update rest client and add new exception * Ensure uploaders continue after wait * Update * Address coderabitai review * Fix tests * Re-generate clients * Address review * Revert attempt handling * Add new exception * Add tests * Do not throw ResourceQuotaExceeded * Add support for async grpc * Remove iscoroutine check and more * update models * Address some coderabbitai comments * Address review * Fix test * Fix backwards compatibility tests * Address review * Get rid of redundant code * Address ai review * refactoring: refactor tests * refactoring: do not inherit resource exhausted from aiorpcerror * fix: remove redundant import --------- Co-authored-by: George Panchuk <george.panchuk@qdrant.tech>
17 lines
555 B
Python
17 lines
555 B
Python
class QdrantException(Exception):
|
|
"""Base class"""
|
|
|
|
|
|
class ResourceExhaustedResponse(QdrantException):
|
|
def __init__(self, message: str, retry_after_s: int) -> None:
|
|
self.message = message if message else "Resource Exhausted Response"
|
|
try:
|
|
self.retry_after_s = int(retry_after_s)
|
|
except Exception as ex:
|
|
raise QdrantException(
|
|
f"Retry-After header value is not a valid integer: {retry_after_s}"
|
|
) from ex
|
|
|
|
def __str__(self) -> str:
|
|
return self.message.strip()
|