File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 99
1010from ..api import NodeType
1111from ..constants import UTF8
12- from ..exceptions import CacheError , NodeError
12+ from ..exceptions import CacheError , MessageError , NodeError
1313from ..helpers .util import validate_mac
1414from ..messages .requests import (
1515 CirclePlusScanRequest ,
@@ -249,9 +249,11 @@ async def register_node(self, mac: str) -> int:
249249 raise NodeError (f"MAC '{ mac } ' invalid" )
250250
251251 request = NodeAddRequest (self ._send_to_controller , bytes (mac , UTF8 ), True )
252- await request .send ()
253- # if response is None or response.ack_id != StickResponseType.ACCEPT:
254- # raise NodeError(f"Failed to register node {mac}")
252+ try :
253+ await request .send ()
254+ except MessageError as exc :
255+ raise MessageError (f"Failed to register Node with { mac } " ) from exc
256+
255257 self .update_network_registration (self ._first_free_address , mac , None )
256258 self ._first_free_address += 1
257259 return self ._first_free_address - 1
You can’t perform that action at this time.
0 commit comments