mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2026-11-05 20:33:11 +01:00
fix(epics_motor): improve error handling in motion status check
This commit is contained in:
1 parent
446aba4606
commit
4e62211469
1 file changed
+13
-5
@@ -358,12 +358,20 @@ class EpicsMotorEC(EpicsMotor):
|
||||
def _check_motion_status(self) -> tuple[bool, Exception | None]:
|
||||
success, exception = super()._check_motion_status()
|
||||
if not success:
|
||||
# Additionally check for ECMC errors
|
||||
error = self.error.get(use_monitor=False)
|
||||
if error:
|
||||
try:
|
||||
# Additionally check for ECMC errors
|
||||
error = self.error.get(use_monitor=False)
|
||||
if error:
|
||||
success = False
|
||||
message_text = self.message_text.get(use_monitor=False)
|
||||
exception = RuntimeError(
|
||||
f"Motor {self.name} reported ECMC error '{message_text}'"
|
||||
)
|
||||
except Exception as e:
|
||||
success = False
|
||||
message_text = self.message_text.get(use_monitor=False)
|
||||
exception = RuntimeError(f"Motor {self.name} reported ECMC error '{message_text}'")
|
||||
exception = RuntimeError(
|
||||
f"Motor {self.name} failed to read ECMC error status after motion: {e}"
|
||||
)
|
||||
return success, exception
|
||||
|
||||
def move(self, position, wait=False, **kwargs) -> MoveStatus:
|
||||
|
||||
Reference in new issue
Block a user