Summary
Several scheduler exception handlers log the error but omit key context (community_id, sync_type, failure count) that would be needed for debugging production issues. The pattern of _track_failure() swallowing context in the except block is fine, but surrounding try/except blocks could do better.
Locations
| File |
Lines |
Issue |
scheduler.py:104 |
except Exception as e: |
Logs to _track_failure but no explicit log line with community_id |
scheduler.py:146 |
Same pattern |
No direct error log with sync context |
scheduler.py:220 |
Same pattern |
Missing community context in error log |
scheduler.py:279 |
Same pattern |
BEP sync errors lack community_id in log |
Current Pattern (deficient)
try:
...
except Exception as e:
_track_failure("github", community_id, e)
return False # No explicit error log with community_id
Recommended Pattern
try:
...
except Exception as e:
logger.error("GitHub sync failed for %s: %s", community_id, e)
_track_failure("github", community_id, e)
return False
Acceptance Criteria
Summary
Several scheduler exception handlers log the error but omit key context (community_id, sync_type, failure count) that would be needed for debugging production issues. The pattern of
_track_failure()swallowing context in the except block is fine, but surrounding try/except blocks could do better.Locations
scheduler.py:104except Exception as e:scheduler.py:146scheduler.py:220scheduler.py:279Current Pattern (deficient)
Recommended Pattern
Acceptance Criteria