diff --git a/lemmylib/lib.py b/lemmylib/lib.py index 656f6a9..648a29d 100644 --- a/lemmylib/lib.py +++ b/lemmylib/lib.py @@ -82,8 +82,10 @@ def call_api(self, method: LemmyApiMethod, endpoint: str, params: dict = None, h if response.ok: return response else: - raise Exception( - f"LemmyLib: API call failed with status code {response.status_code} and message {response.text}") + self._logger.error(f"LemmyLib call_api: " + f"{method} {url}" + f"{response.status_code} {response.text}") + return None def get_base_path(self): return f'/api/{API_VERSION}/'