Commit ab3a82b
authored
Tighten on_error handler type to OrchestratorHookError (#23575)
* Fix on_error type to OrchestratorHookError and remove None return types from tests
* Add changelog
* Make on_error and _apply_error_policy generic over wrapped error type
Codex flagged that _apply_error_policy is also called from _task_wrapper
with MessageProcessingError and ProcessorHookError, so narrowing it to
OrchestratorHookError broke mypy. Make it generic on E: Exception and
turn ErrorHandler into a generic alias so each scope keeps the
relationship between the wrapped-error type and its handler. Tighten
BaseProcessor.on_error to MessageProcessingError | ProcessorHookError to
match its actual contract.1 parent 452d7d2 commit ab3a82b
3 files changed
Lines changed: 54 additions & 57 deletions
File tree
- ddev
- changelog.d
- src/ddev/event_bus
- tests/event_bus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
| 463 | + | |
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
| |||
0 commit comments