Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /BerriAI_litellm /litellm /proxy /client /exceptions.py
| import requests | |
| from litellm.litellm_core_utils.secret_redaction import redact_string | |
| def _redact_orig_exception( | |
| orig_exception: requests.exceptions.HTTPError | str, | |
| ) -> requests.exceptions.HTTPError | str: | |
| if isinstance(orig_exception, requests.exceptions.HTTPError): | |
| return requests.exceptions.HTTPError(redact_string(str(orig_exception)), response=orig_exception.response) | |
| return redact_string(str(orig_exception)) | |
| class UnauthorizedError(Exception): | |
| """Exception raised when the API returns a 401 Unauthorized response.""" | |
| def __init__(self, orig_exception: requests.exceptions.HTTPError | str): | |
| self.orig_exception = _redact_orig_exception(orig_exception) | |
| super().__init__(str(self.orig_exception)) | |
| class NotFoundError(Exception): | |
| """Exception raised when the API returns a 404 Not Found response or indicates a resource was not found.""" | |
| def __init__(self, orig_exception: requests.exceptions.HTTPError | str): | |
| self.orig_exception = _redact_orig_exception(orig_exception) | |
| super().__init__(str(self.orig_exception)) | |
Xet Storage Details
- Size:
- 1.1 kB
- Xet hash:
- acec3c8795f15b43f67a9ff09a51a881fa1899419c106e7296a2d087b3799f91
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.