diff --git a/openwfs/devices/camera.py b/openwfs/devices/camera.py index 3facb5d..2f7130a 100644 --- a/openwfs/devices/camera.py +++ b/openwfs/devices/camera.py @@ -1,3 +1,4 @@ +import warnings from typing import Optional import astropy.units as u @@ -276,8 +277,11 @@ def data_shape(self): @staticmethod def enumerate_cameras(cti_file: str): with Harvester() as harvester: - harvester.add_file(cti_file, check_validity=True) - harvester.update() + try: + harvester.add_file(cti_file, check_validity=True) + harvester.update() + except (OSError, FileNotFoundError): + warnings.warn(f"Failed to load CTI file: {cti_file}") return harvester.device_info_list.copy()