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 715811a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x_notes/tweets.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@ 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 715811a

Please sign in to comment.