Commit e1d656c
committed
Handle the unspecified dispatch event type explicitly
mypy's `exhaustive-match` check (enabled by the `frequenz-repo-config`
0.19.0 migration) reports that the `match` over the event type in the
dispatch stream is missing a case for `Event.UNSPECIFIED`, the enum's
zero value.
The dispatch API should never actually send this, but the enum allows
for it, and the `match` previously covered it only by falling through
silently. Add an explicit case, so a malformed event logs a warning and
gets skipped instead of crashing the whole background service, and the
lack of behaviour beyond that is a documented decision rather than an
oversight.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>1 parent 6598028 commit e1d656c
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
344 | 354 | | |
345 | 355 | | |
346 | 356 | | |
| |||
0 commit comments