Commit 37e04ff
authored
[nightshift] Narrow bare except Exception in fray FileQueue (#3618)
> *Seed scattered wide—*
> *bare catches swallow the bugs,*
> *narrowed, light breaks through.*
- **`file.py`**: Replaced two bare `except Exception:` blocks with
`except OSError:` in `FileQueue.pop()` and
`FileQueue._recover_expired_leases()`. The broad catches silently
swallowed programming errors (TypeError, ValueError, etc.) that should
propagate—only filesystem errors (OSError and subclasses like
FileNotFoundError) are expected here.
- **`http.py`**: Moved `import socket` from inside `get_client_host()`
to module level. It's a stdlib import, not an optional dependency guard,
so it belongs at the top per coding standards §1.1.
Both issues are explicitly flagged as deprecated patterns in
`docs/dev-guide/coding-standards.md` §8.2.1 parent e6ee448 commit 37e04ff
2 files changed
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
119 | | - | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
| |||
0 commit comments