homing: Prefer printer.command_error() instead of homing.CommandError()

Update callers to use the printer.command_error reference instead of
directly using homing.CommandError() when raising or catching errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-09-04 11:49:43 -04:00
parent f6dd97b784
commit 08adecd226
8 changed files with 16 additions and 17 deletions

View file

@ -4,7 +4,7 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import math, logging
import stepper, homing, chelper
import stepper, chelper
class PrinterExtruder:
def __init__(self, config, extruder_num):
@ -214,6 +214,8 @@ class PrinterExtruder:
# Dummy extruder class used when a printer has no extruder at all
class DummyExtruder:
def __init__(self, printer):
self.printer = printer
def update_move_time(self, flush_time):
pass
def check_move(self, move):
@ -223,7 +225,7 @@ class DummyExtruder:
def get_name(self):
return ""
def get_heater(self):
raise homing.CommandError("Extruder not configured")
raise self.printer.command_error("Extruder not configured")
def add_printer_objects(config):
printer = config.get_printer()