Skip to content

Commit 24273a5

Browse files
Replaced print statement with initialization error
1 parent 95bec62 commit 24273a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

microscope/controllers/asi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import microscope.abc
3636
import microscope._utils
37+
from microscope import DeviceError, InitialiseError
3738

3839
_logger = logging.getLogger(__name__)
3940

@@ -225,10 +226,9 @@ def __init__(self, port: str, baudrate: int, timeout: float) -> None:
225226
continue
226227
_logger.info(f"Axis {axis} present")
227228
self.axis_info[axis] = parse_info(answer)
228-
except:
229-
print("Unable to read configuration. Is ASI controller connected?")
230-
return
231229
self.axis_list.append(axis)
230+
except Exception as e:
231+
raise InitialiseError(f"Unable to read configuration. Is ASI controller connected?: {e}")
232232

233233
# As for this version, some MS2000 controllers have integrated control for 2 LEDs
234234
self.led_list = [b"X", b"Y"]

0 commit comments

Comments
 (0)