Files
qdrant-client/qdrant_client/common/client_exceptions.py
tellet-q 635457b47c new: Support for too many requests (#914)
* 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>
2025-03-24 18:05:15 +03:00

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()