From 016f6e62b812ab0adda3d9cdc9e737ef117ba07f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 22 Feb 2026 12:12:55 -0500 Subject: [PATCH] probe_eddy_current: Stop measurements on an error in EddyScanningProbe Register an event handler to make sure measurements are stopped if a gcode error occurs while using EddyScanningProbe. EddyTap and EddyDescend use ProbeSessionHelper which already provides this handling, but EddyScanningProbe doesn't use that wrapper so it must be implemented manually. Signed-off-by: Kevin O'Connor --- klippy/extras/probe_eddy_current.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/klippy/extras/probe_eddy_current.py b/klippy/extras/probe_eddy_current.py index 9863b7d58..447252011 100644 --- a/klippy/extras/probe_eddy_current.py +++ b/klippy/extras/probe_eddy_current.py @@ -609,6 +609,11 @@ class EddyScanningProbe: self._sample_time_delay = 0.050 self._sample_time = 0. self._is_rapid = False + self._printer.register_event_handler("gcode:command_error", + self._handle_command_error) + def _handle_command_error(self): + if self._gather is not None: + self.end_probe_session() def _lookup_toolhead_pos(self, pos_time): toolhead = self._printer.lookup_object('toolhead') kin = toolhead.get_kinematics()