this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improve error handling for 524 timeout errors in bsky.py

Add specific handling for Cloudflare 524 timeout errors to keep
notifications in the queue for retry instead of removing them.
This prevents losing notifications during temporary service
interruptions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

+17
+17
bsky.py
··· 149 149 messages = [{"role":"user", "content": prompt}] 150 150 ) 151 151 except Exception as api_error: 152 + error_str = str(api_error) 152 153 logger.error(f"Letta API error: {api_error}") 154 + logger.error(f"Error type: {type(api_error).__name__}") 153 155 logger.error(f"Mention text was: {mention_text}") 156 + logger.error(f"Author: @{author_handle}") 157 + logger.error(f"URI: {uri}") 158 + 159 + # Check for specific error types 160 + if hasattr(api_error, 'status_code'): 161 + logger.error(f"API Status code: {api_error.status_code}") 162 + if api_error.status_code == 524: 163 + logger.error("524 error - timeout from Cloudflare, will retry later") 164 + return False # Keep in queue for retry 165 + 166 + # Check if error indicates we should remove from queue 167 + if 'status_code: 524' in error_str: 168 + logger.warning("524 timeout error, keeping in queue for retry") 169 + return False # Keep in queue for retry 170 + 154 171 raise 155 172 156 173 # Extract the reply text from the agent's response