1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[bluesky] improve API error messages

This commit is contained in:
Mike Fährmann 2024-02-28 14:45:36 +01:00
parent d921d860f1
commit 7d874e2497
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -447,10 +447,16 @@ class BlueskyAPI():
self.extractor.wait(seconds=60)
continue
try:
data = response.json()
msg = "API request failed ('{}: {}')".format(
data["error"], data["message"])
except Exception:
msg = "API request failed ({} {})".format(
response.status_code, response.reason)
self.extractor.log.debug("Server response: %s", response.text)
raise exception.StopExtraction(
"API request failed (%s %s)",
response.status_code, response.reason)
raise exception.StopExtraction(msg)
def _pagination(self, endpoint, params, key="feed"):
while True: