From 90f088863a6c738347ebb8f16415f8fa0e5ded28 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 28 Apr 2023 09:24:26 -0300 Subject: [PATCH] [v6/v7 Schematic] Better error when we hit an UUID issue --- kibot/kicad/v6_sch.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/kibot/kicad/v6_sch.py b/kibot/kicad/v6_sch.py index ef081fe4..0ced1166 100644 --- a/kibot/kicad/v6_sch.py +++ b/kibot/kicad/v6_sch.py @@ -2188,16 +2188,14 @@ class SchematicV6(Schematic): path = os.path.dirname(s.path) try: sheet = self.sheet_paths[path] - except KeyError: - logger.error(f"Error looking for sheet {path}") - logger.error(f"Available UUIDs {sheet.sheet_paths}") - raise + except KeyError as e: + logger.debug("Available UUIDs {}".format(sheet.sheet_paths)) + raise SchError("Error looking for sheet with UUID `{}`".format(path)) from e try: comp = sheet.symbol_uuids[s.path] - except KeyError: - logger.error(f"Error looking for component {s.path}") - logger.error(f"Available UUIDs {sheet.symbol_uuids}") - raise + except KeyError as e: + logger.debug("Available UUIDs {}".format(sheet.symbol_uuids)) + raise SchError("Error looking for component with UUID `{}`".format(s.path)) from e s.component = comp # Transfer the instance data comp.set_ref(s.reference)