(self)
| 51 | self.explanation = explanation |
| 52 | |
| 53 | def __str__(self): |
| 54 | message = super().__str__() |
| 55 | |
| 56 | if self.is_client_error(): |
| 57 | message = ( |
| 58 | f'{self.response.status_code} Client Error for ' |
| 59 | f'{self.response.url}: {self.response.reason}' |
| 60 | ) |
| 61 | |
| 62 | elif self.is_server_error(): |
| 63 | message = ( |
| 64 | f'{self.response.status_code} Server Error for ' |
| 65 | f'{self.response.url}: {self.response.reason}' |
| 66 | ) |
| 67 | |
| 68 | if self.explanation: |
| 69 | message = f'{message} ("{self.explanation}")' |
| 70 | |
| 71 | return message |
| 72 | |
| 73 | @property |
| 74 | def status_code(self): |
nothing calls this directly
no test coverage detected