Commit 2ea007a3 authored by blissadm_ID31@bibhelm's avatar blissadm_ID31@bibhelm Committed by Matias Guijarro
Browse files

axis: disable controller in case of CommunicationError

parent 192d041b
...@@ -22,6 +22,7 @@ from bliss.config.channels import Channel ...@@ -22,6 +22,7 @@ from bliss.config.channels import Channel
from bliss.common.logtools import log_debug, user_print from bliss.common.logtools import log_debug, user_print
from bliss.common.utils import rounder from bliss.common.utils import rounder
from bliss.common.utils import autocomplete_property from bliss.common.utils import autocomplete_property
from bliss.comm.exceptions import CommunicationError
import enum import enum
import gevent import gevent
...@@ -660,7 +661,10 @@ def lazy_init(func): ...@@ -660,7 +661,10 @@ def lazy_init(func):
raise RuntimeError(f"Axis {self.name} is disabled") raise RuntimeError(f"Axis {self.name} is disabled")
try: try:
self.controller._initialize_axis(self) self.controller._initialize_axis(self)
except Exception: except Exception as e:
if isinstance(e, CommunicationError):
# also disable the controller
self.controller._disabled = True
self._disabled = True self._disabled = True
raise raise
else: else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment