Raises a proper Exception if an error is found in the data.
(self, status, data)
| 122 | raise UnexpectedError from exc |
| 123 | |
| 124 | def check_known_errors(self, status, data): |
| 125 | """Raises a proper Exception if an error is found in the data.""" |
| 126 | if not data: |
| 127 | raise UnexpectedError("Response is empty!") |
| 128 | |
| 129 | if "error" in data: |
| 130 | error = data["error"] |
| 131 | |
| 132 | if error == "Invalid target language" or error == "Invalid source language": |
| 133 | raise InvalidLangCode(error) |
| 134 | else: |
| 135 | raise UnexpectedError(error) |
nothing calls this directly
no test coverage detected