Skip to content

Commit 4cac699

Browse files
committed
Add failt-handling in registry-register_node()
1 parent 1c60120 commit 4cac699

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugwise_usb/network/registry.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ async def register_node(self, mac: str) -> None:
257257
raise NodeError(f"MAC '{mac}' invalid")
258258

259259
request = NodeAddRequest(self._send_to_controller, bytes(mac, UTF8), True)
260-
await request.send()
260+
try:
261+
await request.send()
262+
except StickError as exc:
263+
raise NodeError("{exc}") from exc
261264

262265
async def unregister_node(self, mac: str) -> None:
263266
"""Unregister node from current Plugwise network."""

0 commit comments

Comments
 (0)