@@ -16,7 +16,7 @@ This document contains critical information about working with this codebase. Fo
16
16
- Public APIs must have docstrings
17
17
- Functions must be focused and small
18
18
- Follow existing patterns exactly
19
- - Line length: 88 chars maximum
19
+ - Line length: 120 chars maximum
20
20
21
21
3 . Testing Requirements
22
22
- Framework: ` uv run --frozen pytest `
@@ -26,15 +26,19 @@ This document contains critical information about working with this codebase. Fo
26
26
- Bug fixes require regression tests
27
27
28
28
- For commits fixing bugs or adding features based on user reports add:
29
+
29
30
``` bash
30
31
git commit --trailer " Reported-by:<name>"
31
32
```
33
+
32
34
Where ` <name> ` is the name of the user.
33
35
34
36
- For commits related to a Github issue, add
37
+
35
38
``` bash
36
39
git commit --trailer " Github-Issue:#<number>"
37
40
```
41
+
38
42
- NEVER ever mention a ` co-authored-by ` or similar aspects. In particular, never
39
43
mention the tool used to create the commit message or PR.
40
44
@@ -116,3 +120,15 @@ This document contains critical information about working with this codebase. Fo
116
120
- Follow existing patterns
117
121
- Document public APIs
118
122
- Test thoroughly
123
+
124
+ ## Exception Handling
125
+
126
+ - ** Always use ` logger.exception() ` instead of ` logger.error() ` when catching exceptions**
127
+ - Don't include the exception in the message: ` logger.exception("Failed") ` not ` logger.exception(f"Failed: {e}") `
128
+ - ** Catch specific exceptions** where possible:
129
+ - File ops: ` except (OSError, PermissionError): `
130
+ - JSON: ` except json.JSONDecodeError: `
131
+ - Network: ` except (ConnectionError, TimeoutError): `
132
+ - ** Only catch ` Exception ` for** :
133
+ - Top-level handlers that must not crash
134
+ - Cleanup blocks (log at debug level)
0 commit comments