Skip to content

Commit

Permalink
Raise an exception if no tweets fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed May 12, 2024
1 parent ae8d5c9 commit 4104290
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x_notes/tweets.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@ def get_next_unfetched_note(notes: dict[str, dict[str, Any]]) -> dict[str, Any]
for update_note_id in tweets_with_multi_notes.get(note["tweet_id"], [note_id]):
notes[update_note_id] = {**note, **note_update}

if total_fetched == 0:
raise Exception("Failed to fetch any tweets")

logger.info(f"Total tweets fetched: {total_fetched}")
save_notes(notes)

0 comments on commit 4104290

Please sign in to comment.