Skip to content

Commit

Permalink
[Python] Use to_exception() to convert PyChipError to ChipStackError
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed Jun 17, 2024
1 parent 9ae1144 commit c955d03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controller/python/chip/clusters/Attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ def __init__(self, future: Future, eventLoop, devCtrl, returnClusterObject: bool
self._changedPathSet = set()
self._pReadClient = None
self._pReadCallback = None
self._resultError = None
self._resultError: PyChipError | None = None

def SetClientObjPointers(self, pReadClient, pReadCallback):
self._pReadClient = pReadClient
Expand Down Expand Up @@ -781,7 +781,7 @@ def _handleDone(self):
if self._subscription_handler:
self._subscription_handler.OnErrorCb(self._resultError, self._subscription_handler)
else:
self._future.set_exception(chip.exceptions.ChipStackError(self._resultError))
self._future.set_exception(self._resultError.to_exception())
else:
self._future.set_result(AsyncReadTransaction.ReadResponse(
attributes=self._cache.attributeCache, events=self._events, tlvAttributes=self._cache.attributeTLVCache))
Expand Down Expand Up @@ -809,7 +809,7 @@ def __init__(self, future: Future, eventLoop):
self._event_loop = eventLoop
self._future = future
self._resultData = []
self._resultError = None
self._resultError: PyChipError | None = None

def handleResponse(self, path: AttributePath, status: int):
try:
Expand Down

0 comments on commit c955d03

Please sign in to comment.