From 6ca27afa9cc6277fcf838b07fb2cbe6149e2ba0c Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Fri, 26 Jun 2026 11:32:54 +0200 Subject: [PATCH] fix(controller): enhance error handling in retry_once decorator with traceback logging --- ophyd_devices/utils/controller.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ophyd_devices/utils/controller.py b/ophyd_devices/utils/controller.py index c36990d..d306411 100644 --- a/ophyd_devices/utils/controller.py +++ b/ophyd_devices/utils/controller.py @@ -1,5 +1,6 @@ import functools import threading +import traceback from collections import deque from typing import TYPE_CHECKING, Type @@ -43,7 +44,11 @@ def retry_once(fcn): def wrapper(self, *args, **kwargs): try: val = fcn(self, *args, **kwargs) - except ControllerCommunicationError: + except Exception: + content = traceback.format_exc() + logger.warning( + f"Communication error occurred. Retrying the command. Traceback: {content}" + ) val = fcn(self, *args, **kwargs) return val