Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True
| 2 | |
| 3 | |
| 4 | class UnexpectedStatus(Exception): |
| 5 | """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" |
| 6 | |
| 7 | def __init__(self, status_code: int, content: bytes): |
| 8 | self.status_code = status_code |
| 9 | self.content = content |
| 10 | |
| 11 | super().__init__( |
| 12 | f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" |
| 13 | ) |
| 14 | |
| 15 | |
| 16 | __all__ = ["UnexpectedStatus"] |
nothing calls this directly
no outgoing calls
no test coverage detected