Skip to content

Commit 0e0fe0a

Browse files
Fix bare except clauses to use Exception
Co-authored-by: Lackadaisical-Security <205846242+Lackadaisical-Security@users.noreply.github.com>
1 parent ce3bf31 commit 0e0fe0a

4 files changed

Lines changed: 25 additions & 12 deletions

File tree

REALTIME_STATS.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"timestamp": "2026-01-05T14:36:19.877520Z",
2+
"timestamp": "2026-01-05T14:37:41.805435Z",
33
"local": {
4-
"commit_count": 4,
4+
"commit_count": 5,
55
"unique_contributors": 2,
6-
"last_commit_date": "2026-01-05 14:33:19 +0000",
7-
"last_commit_message": "Improve GitHub API error handling and update auth format",
6+
"last_commit_date": "2026-01-05 14:36:30 +0000",
7+
"last_commit_message": "Add caching for GitHub stats when API calls fail",
88
"current_branch": "copilot/fix-real-time-stats-api",
99
"tracked_files": 63,
10-
"timestamp": "2026-01-05T14:36:19.888287Z"
10+
"timestamp": "2026-01-05T14:37:41.816614Z"
1111
},
1212
"github": {}
1313
}

REALTIME_STATS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Repository Statistics - Real-Time
22

3-
**Last Updated:** 2026-01-05T14:36:19.877520Z
3+
**Last Updated:** 2026-01-05T14:37:41.805435Z
44

55
## 📊 Current Statistics
66

@@ -9,11 +9,11 @@
99
| Metric | Value |
1010
|--------|-------|
1111
| 🌿 Current Branch | `copilot/fix-real-time-stats-api` |
12-
| 📝 Total Commits | 4 |
12+
| 📝 Total Commits | 5 |
1313
| 👥 Contributors | 2 |
1414
| 📄 Tracked Files | 63 |
15-
| 🕐 Last Commit | 2026-01-05 14:33:19 |
16-
| 💬 Last Message | Improve GitHub API error handling and update auth format |
15+
| 🕐 Last Commit | 2026-01-05 14:36:30 |
16+
| 💬 Last Message | Add caching for GitHub stats when API calls fail |
1717

1818
---
1919

@@ -22,7 +22,7 @@
2222
Add these to your README.md:
2323

2424
```markdown
25-
<img src="https://img.shields.io/badge/commits-4-orange?style=flat-square">
25+
<img src="https://img.shields.io/badge/commits-5-orange?style=flat-square">
2626
```
2727

2828
---

STATS_HISTORY.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,18 @@
154154
"timestamp": "2026-01-05T14:36:19.888287Z"
155155
},
156156
"github": {}
157+
},
158+
{
159+
"timestamp": "2026-01-05T14:37:41.805435Z",
160+
"local": {
161+
"commit_count": 5,
162+
"unique_contributors": 2,
163+
"last_commit_date": "2026-01-05 14:36:30 +0000",
164+
"last_commit_message": "Add caching for GitHub stats when API calls fail",
165+
"current_branch": "copilot/fix-real-time-stats-api",
166+
"tracked_files": 63,
167+
"timestamp": "2026-01-05T14:37:41.816614Z"
168+
},
169+
"github": {}
157170
}
158171
]

realtime_stats_tracker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def github_api_request(self, endpoint):
4747
error_body = e.read().decode()
4848
error_data = json.loads(error_body)
4949
error_msg = error_data.get('message', '')
50-
except:
50+
except Exception:
5151
pass
5252

5353
if e.code == 403:
@@ -181,7 +181,7 @@ def collect_stats(self):
181181
with open(self.stats_file, 'r') as f:
182182
previous_data = json.load(f)
183183
previous_github_stats = previous_data.get('github', {})
184-
except:
184+
except Exception:
185185
pass
186186

187187
stats = {

0 commit comments

Comments
 (0)