Commit 021db78
committed
aioble/l2cap: Use DeviceDisconnectedError directly.
L2CAPChannel.__init__ raised ValueError("Not connected") when the
connection was already disconnected. Change this to raise
DeviceDisconnectedError directly, which is the exception callers
(e.g. l2cap_file_server example) already catch.
Also make L2CAPDisconnectedError a subclass of DeviceDisconnectedError
so that mid-operation L2CAP disconnections are caught by the same
handler.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>1 parent d0511a4 commit 021db78
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
0 commit comments