From 535f806c96d9d348bd2d2e16a042a9ce08be0cb0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 24 Jul 2024 19:28:47 +1000 Subject: [PATCH] Tools: make include file mistakes nicer to interpret --- Tools/ardupilotwaf/boards.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 701bccfdc4199..65452f8d08b74 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -618,8 +618,12 @@ def get_ap_periph_boards(): hwdef = os.path.join(dirname, d, 'hwdef.dat') if os.path.exists(hwdef): ch = chibios_hwdef.ChibiOSHWDef(hwdef=[hwdef], quiet=True) - if ch.is_periph_fw_unprocessed(): - list_ap.append(d) + try: + if ch.is_periph_fw_unprocessed(): + list_ap.append(d) + except chibios_hwdef.ChibiOSHWDefIncludeNotFoundException as e: + print(f"{e.includer} includes {e.hwdef} which does not exist") + sys.exit(1) list_ap = list(set(list_ap)) return list_ap