Commit c3db8e2
fix: wrap aiohttp network errors in RoborockException (#835)
Network-class exceptions raised inside PreparedRequest.request
(aiohttp.ClientError, TimeoutError, OSError) were bubbling out
unwrapped, bypassing consumers that catch RoborockException. This
caused Home Assistant's roborock integration to mark config entries
as terminally failed after a power outage when DNS hadn't resolved
yet, requiring a manual restart to recover.
Catch the network-class exceptions at the single chokepoint
(PreparedRequest.request) and re-raise as RoborockException,
preserving the original cause via `from err`. Every method on
RoborockApiClient / UserWebApiClient benefits since they all route
through this method.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 81daad1 commit c3db8e2
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
| 696 | + | |
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
0 commit comments