Skip to content

Commit

Permalink
Throw exception instead of return 0 for get-fabricid in case of error (
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored Jun 30, 2021
1 parent 9c01258 commit 07894bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controller/python/chip/ChipDeviceCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ def DiscoverAllCommissioning(self):
def GetFabricId(self):
fabricid = c_uint64(0)

error = self._ChipStack.Call(
res = self._ChipStack.Call(
lambda: self._dmLib.pychip_DeviceController_GetFabricId(
self.devCtrl, pointer(fabricid))
)

if error == 0:
if res == 0:
return fabricid.value
else:
return 0
raise self._ChipStack.ErrorToException(res)

def ZCLSend(self, cluster, command, nodeid, endpoint, groupid, args, blocking=False):
device = c_void_p(None)
Expand Down

0 comments on commit 07894bd

Please sign in to comment.