Commit f220d64f authored by Robin Mueller's avatar Robin Mueller
Browse files

try except for robustness

parent b3e034f0
......@@ -11,8 +11,11 @@ def determine_com_port() -> str:
if os.path.isfile("config/tmtcc_config.json"):
with open("config/tmtcc_config.json", "r") as write:
load_data = json.load(write)
com_port = load_data["COM_PORT"]
try:
load_data = json.load(write)
com_port = load_data["COM_PORT"]
except KeyError:
reconfigure_com_port = True
if not check_port_validity(com_port):
reconfigure = input(
"COM port from configuration file not contained within serial"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment