Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

17 строки
546 B

  1. """Contains shared errors types that can be raised from API functions"""
  2. class UnexpectedStatus(Exception):
  3. """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""
  4. def __init__(self, status_code: int, content: bytes):
  5. self.status_code = status_code
  6. self.content = content
  7. super().__init__(
  8. f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}"
  9. )
  10. __all__ = ["UnexpectedStatus"]