File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1010
1111from .exceptions import (
1212 ConnectionAuthenticationError ,
13- ConnectionError ,
1413 ConnectionSetupError ,
1514 DataMissingError ,
15+ DeviceConnectionError ,
1616)
1717
1818logger = logging .getLogger (__name__ )
@@ -178,13 +178,13 @@ async def login(self) -> bool:
178178 raise ConnectionAuthenticationError from None
179179 except aiohttp .ClientError as err :
180180 logger .exception ("Error during login" )
181- raise ConnectionError from err
181+ raise DeviceConnectionError from err
182182
183183 async def status (self ) -> dict :
184184 """Retrieve status from the device."""
185185 if not self .connected :
186186 logger .error ("Not connected, login first" )
187- raise ConnectionError from None
187+ raise DeviceConnectionError from None
188188
189189 # --- Step 2: Verify authenticated access by fetching status.cgi ---
190190 authenticated_get_headers = {** self ._common_headers }
@@ -210,4 +210,4 @@ async def status(self) -> dict:
210210 logger .error (log )
211211 except aiohttp .ClientError as err :
212212 logger .exception ("Error during authenticated status.cgi call" )
213- raise ConnectionError from err
213+ raise DeviceConnectionError from err
Original file line number Diff line number Diff line change @@ -5,10 +5,6 @@ class AirOSException(Exception):
55 """Base error class for this AirOS library."""
66
77
8- class ConnectionError (AirOSException ):
9- """Raised when unable to connect."""
10-
11-
128class ConnectionSetupError (AirOSException ):
139 """Raised when unable to prepare authentication."""
1410
@@ -19,3 +15,7 @@ class ConnectionAuthenticationError(AirOSException):
1915
2016class DataMissingError (AirOSException ):
2117 """Raised when expected data is missing."""
18+
19+
20+ class DeviceConnectionError (AirOSException ):
21+ """Raised when unable to connect."""
You can’t perform that action at this time.
0 commit comments