From 04acc06e95098d7e2f9b4af404447c9cfaee5b99 Mon Sep 17 00:00:00 2001 From: Stijn Peeters Date: Mon, 15 Jul 2024 11:27:30 +0200 Subject: [PATCH] Unbreak Twitter error handling --- datasources/twitterv2/search_twitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datasources/twitterv2/search_twitter.py b/datasources/twitterv2/search_twitter.py index efc9fb5b2..999680b6e 100644 --- a/datasources/twitterv2/search_twitter.py +++ b/datasources/twitterv2/search_twitter.py @@ -290,7 +290,7 @@ def get_items(self, query): self.dataset.log('Missing objects collected: ' + ', '.join(['%s: %s' % (k, len(v)) for k, v in missing_objects.items()])) if num_missing_objects > 50: # Large amount of missing objects; possible error with Twitter API - self.flawless = False + self.import_issues = False error_report.append('%i missing objects received following tweet number %i. Possible issue with Twitter API.' % (num_missing_objects, tweets)) error_report.append('Missing objects collected: ' + ', '.join(['%s: %s' % (k, len(v)) for k, v in missing_objects.items()])) @@ -333,7 +333,7 @@ def get_items(self, query): else: break - if not self.flawless: + if not self.import_issues: self.dataset.log('Error Report:\n' + '\n'.join(error_report)) self.dataset.update_status("Completed with errors; Check log for Error Report.", is_final=True)