From ee0451d80b765bb82c1ce36563bbe396f1ad49ea Mon Sep 17 00:00:00 2001 From: appel_c Date: Sat, 16 May 2026 10:09:47 +0200 Subject: [PATCH] fix(jungfraujoch-preview): fix error handling for jungfraujoch preview client. --- csaxs_bec/devices/jungfraujoch/jungfraujoch_preview.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/devices/jungfraujoch/jungfraujoch_preview.py b/csaxs_bec/devices/jungfraujoch/jungfraujoch_preview.py index a6cf358..5364c70 100644 --- a/csaxs_bec/devices/jungfraujoch/jungfraujoch_preview.py +++ b/csaxs_bec/devices/jungfraujoch/jungfraujoch_preview.py @@ -213,7 +213,12 @@ class JungfrauJochPreview: # pylint: disable=no-member r = self._socket.recv_multipart(flags=zmq.NOBLOCK) self._parse_data(r) - + except zmq.error.Again: + # No message received, this is expected when the receive queue is empty + pass + except Exception as e: + # Consider moving this to debug level, but it can be useful to see why preview updates are not working + logger.info(f"Error while receiving ZMQ message from JFJ preview at {self.url}: {e}") finally: # Unsubscribe from the topic self._socket.setsockopt(zmq.UNSUBSCRIBE, ZMQ_TOPIC_FILTER)