[twitter] report API errors as generic StopExtraction exceptions

prevents duplicate logging messages for nonexistent users
(#1759)
This commit is contained in:
Mike Fährmann
2021-08-18 01:50:21 +02:00
parent 51eb50749f
commit 6b56b3ebe1

View File

@@ -749,8 +749,8 @@ class TwitterAPI():
) )
except Exception: except Exception:
msg = data["errors"] msg = data["errors"]
if response.status_code < 400: if msg and response.status_code < 400:
self.extractor.log.warning(msg) raise exception.StopExtraction(msg)
else: else:
msg = "" msg = ""