Commit 4c1f919
committed
Introduce domain exception hierarchy for transport-agnostic services
- Add base exceptions in app/domain/exceptions.py (NotFoundError,
ValidationError, ThrottledError, ConflictError, UnauthorizedError,
ForbiddenError, InvalidStateError, InfrastructureError)
- Create domain-specific exceptions for execution, saga, notification,
saved_script, replay, and user/auth modules
- Update all services to throw domain exceptions instead of HTTPException
- Add single exception handler middleware that maps to HTTP status codes
- Add documentation in docs/architecture/domain-exceptions.md
Services no longer know about HTTP semantics. The middleware handles
all mapping from domain exceptions to JSON responses.1 parent 6b26179 commit 4c1f919
File tree
210 files changed
+4988
-8042
lines changed- backend
- app
- api/routes
- admin
- core
- exceptions
- metrics
- middlewares
- tracing
- db
- docs
- repositories
- admin
- schema
- dlq
- domain
- admin
- events
- execution
- notification
- replay
- saga
- saved_script
- user
- events
- core
- schema
- infrastructure/mappers
- schemas_pydantic
- services
- admin
- coordinator
- event_replay
- idempotency
- k8s_worker
- pod_monitor
- result_processor
- saga
- sse
- scripts
- tests
- integration
- db
- repositories
- schema
- dlq
- events
- idempotency
- k8s
- result_processor
- services
- events
- sse
- unit
- core
- metrics
- dlq
- events
- infrastructure/mappers
- services
- coordinator
- idempotency
- pod_monitor
- result_processor
- saga
- sse
- workers
- docs
- architecture
- components/saga
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
210 files changed
+4988
-8042
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | | - | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
82 | | - | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| |||
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
114 | | - | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
| |||
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
162 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
14 | 42 | | |
15 | 43 | | |
16 | 44 | | |
| |||
23 | 51 | | |
24 | 52 | | |
25 | 53 | | |
26 | | - | |
27 | | - | |
| 54 | + | |
28 | 55 | | |
29 | 56 | | |
30 | 57 | | |
| |||
37 | 64 | | |
38 | 65 | | |
39 | 66 | | |
40 | | - | |
41 | | - | |
| 67 | + | |
42 | 68 | | |
43 | 69 | | |
44 | 70 | | |
| |||
52 | 78 | | |
53 | 79 | | |
54 | 80 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 81 | + | |
58 | 82 | | |
59 | 83 | | |
60 | 84 | | |
| |||
67 | 91 | | |
68 | 92 | | |
69 | 93 | | |
70 | | - | |
71 | | - | |
| 94 | + | |
72 | 95 | | |
73 | 96 | | |
74 | 97 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | | - | |
155 | | - | |
156 | | - | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 162 | | |
166 | | - | |
| 163 | + | |
167 | 164 | | |
168 | 165 | | |
169 | 166 | | |
| |||
204 | 201 | | |
205 | 202 | | |
206 | 203 | | |
| 204 | + | |
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
| |||
227 | 225 | | |
228 | 226 | | |
229 | 227 | | |
| 228 | + | |
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| |||
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
0 commit comments