mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
[bluesky] improve API error messages
This commit is contained in:
parent
d921d860f1
commit
7d874e2497
@ -447,10 +447,16 @@ class BlueskyAPI():
|
|||||||
self.extractor.wait(seconds=60)
|
self.extractor.wait(seconds=60)
|
||||||
continue
|
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)
|
self.extractor.log.debug("Server response: %s", response.text)
|
||||||
raise exception.StopExtraction(
|
raise exception.StopExtraction(msg)
|
||||||
"API request failed (%s %s)",
|
|
||||||
response.status_code, response.reason)
|
|
||||||
|
|
||||||
def _pagination(self, endpoint, params, key="feed"):
|
def _pagination(self, endpoint, params, key="feed"):
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
Reference in New Issue
Block a user