From 677911967a2e2defe4ba20201962c48c5b66f6f6 Mon Sep 17 00:00:00 2001 From: Jarrett Date: Tue, 1 May 2018 16:07:26 -0700 Subject: [PATCH] Improved error handling for JSON files --- pcbmode/utils/component.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbmode/utils/component.py b/pcbmode/utils/component.py index 5c05081f..ecc62a6e 100644 --- a/pcbmode/utils/component.py +++ b/pcbmode/utils/component.py @@ -53,7 +53,10 @@ def __init__(self, refdef, component): footprint_dict = None for path in paths: if os.path.isfile(path): - footprint_dict = dictFromJsonFile(path) + try: + footprint_dict = dictFromJsonFile(path) + except: + msg.error("Cannot parse JSON at file %s." % path) break if footprint_dict == None: