fix: return 0 if ring current device is not accessible #119
@@ -9,6 +9,7 @@ from aarecommon.errors.exception_handler import BECCommunicationError
|
||||
from aarecommon.models.beamline import MXBeamline
|
||||
from bec_ipython_client import BECIPythonClient
|
||||
from bec_ipython_client.signals import OperationMode
|
||||
from bec_lib.device import RPCError, ScanRequestError
|
||||
from bec_lib.procedures.helper import FrontendProcedureHelper
|
||||
from bec_lib.service_config import ServiceConfig
|
||||
|
||||
@@ -527,7 +528,11 @@ class BECClientWorker:
|
||||
|
||||
@property
|
||||
def ring_current(self) -> float:
|
||||
return self._ring_current.get()
|
||||
try:
|
||||
return self._ring_current.get()
|
||||
except (RPCError, ScanRequestError) as e:
|
||||
logger.warning(f"Ring current BEC device is not available: {e}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user