diff --git a/klippy/klippy.py b/klippy/klippy.py index 151bd1c6..849c5b8b 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -34,6 +34,7 @@ Printer is shutdown """ class ConfigWrapper: + error = ConfigParser.Error def __init__(self, printer, section): self.printer = printer self.section = section diff --git a/klippy/mcu.py b/klippy/mcu.py index e039f2d5..09942df8 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -399,8 +399,14 @@ class MCU: pnames = pins.mcu_to_pins(mcu) else: pnames = pins.map_pins(pin_map, mcu) - self._config_cmds = [pins.update_command(c, pnames) - for c in self._config_cmds] + updated_cmds = [] + for cmd in self._config_cmds: + try: + updated_cmds.append(pins.update_command(cmd, pnames)) + except: + raise self._config.error("Unable to translate pin name: %s" % ( + cmd,)) + self._config_cmds = updated_cmds # Calculate config CRC self._config_crc = zlib.crc32('\n'.join(self._config_cmds)) & 0xffffffff