Raise an error if the argument resolves to an error object.
(cls, data: list[Any] | dict[str, Any])
| 19 | |
| 20 | @classmethod |
| 21 | def check_error(cls, data: list[Any] | dict[str, Any]) -> None: |
| 22 | """Raise an error if the argument resolves to an error object.""" |
| 23 | if error := cls.parse_error(data): |
| 24 | raise error |
| 25 | |
| 26 | @classmethod |
| 27 | def parse_error(cls, data: list[Any] | dict[str, Any]) -> RedditAPIException | None: |