diff --git a/twitter2bsky_daemon.py b/twitter2bsky_daemon.py index 4a077c5..1963d7f 100644 --- a/twitter2bsky_daemon.py +++ b/twitter2bsky_daemon.py @@ -3334,19 +3334,18 @@ def sync_feeds(args): logging.error(f"❌ Failed to post tweet to Bluesky: {e}") browser.close() + except Exception as e: + logging.error(f"❌ Failed to post tweet to Bluesky: {e}") - except Exception as e: - logging.error(f"❌ Failed to post tweet to Bluesky: {e}") + browser.close() - browser.close() + # This must be indented 8 spaces (inside the try block) + logging.info(f"✅ Sync complete. Posted {new_posts} new updates.") - logging.info(f"✅ Sync complete. Posted {new_posts} new updates.") - - # 👇 This except block must be indented 4 spaces to match the try block at the top of sync_feeds! + # This must be indented 4 spaces (matches the 'try:' at the top of sync_feeds) except Exception as e: logging.error(f"❌ Error during sync cycle: {e}") - def main(): load_dotenv()