exceptions.py 303 B

12345678910111213
  1. from http import HTTPStatus
  2. from typing import Any
  3. __all__ = ["ApiException"]
  4. class ApiException(ValueError):
  5. def __init__(self, obj: Any, status: HTTPStatus):
  6. self.status = status
  7. super().__init__(obj)
  8. def __str__(self):
  9. return f"{self.status}: {super().__str__()}"