improve Dependency (131) handling #166

Этот коммит содержится в:
Vlad Pronsky 2024-04-18 05:46:23 +03:00
родитель 6ed84ae45e
Коммит cd5724b002

Просмотреть файл

@ -170,6 +170,11 @@ class QueueClient:
# something from twitter side - abort all queries, see: https://github.com/vladkens/twscrape/pull/80
if err_msg.startswith("(131) Dependency: Internal error"):
# looks like when data exists, we can ignore this error
# https://github.com/vladkens/twscrape/issues/166
if rep.status_code == 200 and "data" in res and "user" in res["data"]:
err_msg = "OK"
else:
logger.warning(f"Dependency error (request skipped): {err_msg}")
raise AbortReqError()