Skip to content

Commit

Permalink
catching exception when no driver installed
Browse files Browse the repository at this point in the history
  • Loading branch information
IvoVellekoop committed Oct 11, 2024
1 parent b7d8c70 commit 7e119d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions openwfs/devices/camera.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from typing import Optional

import astropy.units as u
Expand Down Expand Up @@ -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()


Expand Down

0 comments on commit 7e119d0

Please sign in to comment.