Skip to content

Commit

Permalink
Catch exception more specifically
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed May 14, 2024
1 parent b225168 commit 138a686
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/controller/python/test/test_scripts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from chip import ChipDeviceCtrl
from chip.ChipStack import ChipStack
from chip.crypto import p256keypair
from chip.exceptions import ChipStackError
from chip.utils import CommissioningBuildingBlocks
from cirque_restart_remote_device import restartRemoteDevice
from ecdsa import NIST256p
Expand Down Expand Up @@ -375,7 +376,7 @@ async def TestFailsafe(self, nodeid: int):
self.logger.error(
'Incorrectly succeeded in opening basic commissioning window')
return False
except Exception:
except ChipStackError:
pass

# TODO:
Expand Down Expand Up @@ -403,7 +404,7 @@ async def TestFailsafe(self, nodeid: int):
self.logger.error(
'Incorrectly succeeded in opening enhanced commissioning window')
return False
except Exception:
except ChipStackError:
pass

self.logger.info("Disarming failsafe on CASE connection")
Expand Down Expand Up @@ -1197,7 +1198,7 @@ class AttributeWriteRequest:
if req.expected_status != IM.Status.Success:
raise AssertionError(
f"Write attribute {req.attribute.__qualname__} expects failure but got success response")
except Exception as ex:
except ChipStackError as ex:
if req.expected_status != IM.Status.Success:
continue
else:
Expand Down

0 comments on commit 138a686

Please sign in to comment.