fix: return 0 if ring current device is not accessible
CI / lint (pull_request) Successful in 1m12s
Build and Publish / release (push) Successful in 14s
CI / test (3.11) (pull_request) Successful in 1m43s
CI / test (3.13) (pull_request) Successful in 3m35s
CI / test (3.12) (pull_request) Successful in 5m40s
CI / test (3.13) (push) Successful in 1m33s
CI / lint (push) Successful in 7m56s
CI / test (3.12) (push) Successful in 3m27s
CI / test (3.11) (push) Successful in 5m9s
CI / lint (pull_request) Successful in 1m12s
Build and Publish / release (push) Successful in 14s
CI / test (3.11) (pull_request) Successful in 1m43s
CI / test (3.13) (pull_request) Successful in 3m35s
CI / test (3.12) (pull_request) Successful in 5m40s
CI / test (3.13) (push) Successful in 1m33s
CI / lint (push) Successful in 7m56s
CI / test (3.12) (push) Successful in 3m27s
CI / test (3.11) (push) Successful in 5m9s
This commit was merged in pull request #119.
This commit is contained in:
1 parent
c76d5d29a3
commit
69421be3e9
1 file changed
+6
-1
@@ -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