mirror of https://github.com/Desuuuu/klipper.git
homing: Improve error messages on a printer shutdown during homing
If a shutdown occurs during homing, make sure any follow up errors are clear that the cause of the error is the shutdown. This suppresses the confusing "Unable to obtain 'trsync_state' response" messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
afada5e79e
commit
fa7a91a38b
|
@ -184,12 +184,24 @@ class PrinterHoming:
|
||||||
def manual_home(self, toolhead, endstops, pos, speed,
|
def manual_home(self, toolhead, endstops, pos, speed,
|
||||||
triggered, check_triggered):
|
triggered, check_triggered):
|
||||||
hmove = HomingMove(self.printer, endstops, toolhead)
|
hmove = HomingMove(self.printer, endstops, toolhead)
|
||||||
hmove.homing_move(pos, speed, triggered=triggered,
|
try:
|
||||||
check_triggered=check_triggered)
|
hmove.homing_move(pos, speed, triggered=triggered,
|
||||||
|
check_triggered=check_triggered)
|
||||||
|
except self.printer.command_error:
|
||||||
|
if self.printer.is_shutdown():
|
||||||
|
raise self.printer.command_error(
|
||||||
|
"Homing failed due to printer shutdown")
|
||||||
|
raise
|
||||||
def probing_move(self, mcu_probe, pos, speed):
|
def probing_move(self, mcu_probe, pos, speed):
|
||||||
endstops = [(mcu_probe, "probe")]
|
endstops = [(mcu_probe, "probe")]
|
||||||
hmove = HomingMove(self.printer, endstops)
|
hmove = HomingMove(self.printer, endstops)
|
||||||
epos = hmove.homing_move(pos, speed, probe_pos=True)
|
try:
|
||||||
|
epos = hmove.homing_move(pos, speed, probe_pos=True)
|
||||||
|
except self.printer.command_error:
|
||||||
|
if self.printer.is_shutdown():
|
||||||
|
raise self.printer.command_error(
|
||||||
|
"Probing failed due to printer shutdown")
|
||||||
|
raise
|
||||||
if hmove.check_no_movement() is not None:
|
if hmove.check_no_movement() is not None:
|
||||||
raise self.printer.command_error(
|
raise self.printer.command_error(
|
||||||
"Probe triggered prior to movement")
|
"Probe triggered prior to movement")
|
||||||
|
@ -208,6 +220,9 @@ class PrinterHoming:
|
||||||
try:
|
try:
|
||||||
kin.home(homing_state)
|
kin.home(homing_state)
|
||||||
except self.printer.command_error:
|
except self.printer.command_error:
|
||||||
|
if self.printer.is_shutdown():
|
||||||
|
raise self.printer.command_error(
|
||||||
|
"Homing failed due to printer shutdown")
|
||||||
self.printer.lookup_object('stepper_enable').motor_off()
|
self.printer.lookup_object('stepper_enable').motor_off()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue