diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 6b78a73920d58b..1eb1960ad8d999 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -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)