@@ -651,7 +651,7 @@ def __init__(self, future: Future, eventLoop, devCtrl, returnClusterObject: bool
651
651
self ._changedPathSet = set ()
652
652
self ._pReadClient = None
653
653
self ._pReadCallback = None
654
- self ._resultError = None
654
+ self ._resultError : Optional [ PyChipError ] = None
655
655
656
656
def SetClientObjPointers (self , pReadClient , pReadCallback ):
657
657
self ._pReadClient = pReadClient
@@ -718,7 +718,7 @@ def handleEventData(self, header: EventHeader, path: EventPath, data: bytes, sta
718
718
logging .exception (ex )
719
719
720
720
def handleError (self , chipError : PyChipError ):
721
- self ._resultError = chipError . code
721
+ self ._resultError = chipError
722
722
723
723
def _handleSubscriptionEstablished (self , subscriptionId ):
724
724
if not self ._future .done ():
@@ -777,11 +777,11 @@ def _handleDone(self):
777
777
# move on, possibly invalidating the provided _event_loop.
778
778
#
779
779
if not self ._future .done ():
780
- if self ._resultError :
780
+ if self ._resultError is not None :
781
781
if self ._subscription_handler :
782
- self ._subscription_handler .OnErrorCb (self ._resultError , self ._subscription_handler )
782
+ self ._subscription_handler .OnErrorCb (self ._resultError . code , self ._subscription_handler )
783
783
else :
784
- self ._future .set_exception (chip . exceptions . ChipStackError ( self ._resultError ))
784
+ self ._future .set_exception (self ._resultError . to_exception ( ))
785
785
else :
786
786
self ._future .set_result (AsyncReadTransaction .ReadResponse (
787
787
attributes = self ._cache .attributeCache , events = self ._events , tlvAttributes = self ._cache .attributeTLVCache ))
@@ -809,7 +809,7 @@ def __init__(self, future: Future, eventLoop):
809
809
self ._event_loop = eventLoop
810
810
self ._future = future
811
811
self ._resultData = []
812
- self ._resultError = None
812
+ self ._resultError : Optional [ PyChipError ] = None
813
813
814
814
def handleResponse (self , path : AttributePath , status : int ):
815
815
try :
0 commit comments