From 9d227c089373823aa5030ea2b9328a3d51d1df8e Mon Sep 17 00:00:00 2001 From: Markus Heikkinen Date: Tue, 7 Feb 2023 12:24:31 +0100 Subject: [PATCH] find_zsync_worker_port to raise ToolkitError --- src/zhinst/toolkit/driver/devices/pqsc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zhinst/toolkit/driver/devices/pqsc.py b/src/zhinst/toolkit/driver/devices/pqsc.py index 431fc1ff..e18ae44d 100644 --- a/src/zhinst/toolkit/driver/devices/pqsc.py +++ b/src/zhinst/toolkit/driver/devices/pqsc.py @@ -5,6 +5,7 @@ from typing import List, Union from zhinst.toolkit.driver.devices.base import BaseInstrument +from zhinst.toolkit.exceptions import ToolkitError logger = logging.getLogger(__name__) @@ -233,7 +234,7 @@ def find_zsync_worker_port(self, device: BaseInstrument) -> int: Integer value represent the ID of the searched PQSC Zsync port. Raises: - RuntimeError: If the given device doesn't appear to be connected + ToolkitError: If the given device doesn't appear to be connected to the PQSC via ZSync. .. versionadded:: 0.5.1 @@ -248,7 +249,7 @@ def find_zsync_worker_port(self, device: BaseInstrument) -> int: try: device_zsync_node = serial_to_node_dict[device_serial] except KeyError: - raise RuntimeError( + raise ToolkitError( "No ZSync connection found between the PQSC " f"{self.serial} and the device {device.serial}." )