diff --git a/concert/devices/cameras/uca.py b/concert/devices/cameras/uca.py index 5ec92747f..751f7a39c 100644 --- a/concert/devices/cameras/uca.py +++ b/concert/devices/cameras/uca.py @@ -2,6 +2,7 @@ Cameras supported by the libuca library. """ import time +import logbook import numpy as np from concert.coroutines import null from concert.helpers import async, inject @@ -11,6 +12,9 @@ from concert.devices.cameras import base +LOG = logbook.Logger(__name__) + + def _new_setter_wrapper(camera, name, unit=None): def _wrapper(value): if unit: @@ -100,7 +104,12 @@ def readout(self, condition=lambda: True): as long as it resolves to True the camera keeps grabbing. """ while condition(): - image = self.grab() + image = None + try: + image = self.grab() + except Exception as exc: + LOG.debug("An error {} occured".format(exc) + + " during readout, stopping") if image is None: break yield image