From a38e38f96e238ee5f4ab4b63f0f409127bc2bc50 Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Mon, 14 Feb 2022 13:34:52 +0100 Subject: [PATCH] config loading errors done --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 5175d6e..3a59673 100644 --- a/main.py +++ b/main.py @@ -89,9 +89,8 @@ if os.path.isfile(config_file_path): config_file = open(config_file_path, "r") configuration = json.loads(config_file.read()) config_file.close() - except: - #TODO: show an error message - warn("Not implemented!") + except Exception: + error("An exception occurred while trying to load the configuration.", handle_gracefully=False) else: # config not found dialog_interaction_handler = Window_Interaction_Handler() @@ -109,9 +108,11 @@ else: #TODO: store default configuration warn("Not implemented!") else: - print("No config present and user chose not to create one. Exiting.") + error("No config present and user chose not to create one. Exiting.", is_exception=False, handle_gracefully=True) + # exit with success exit code anyway because this is not a program failure sys.exit(EXIT_SUCCESS) + #window = tk.Tk() #frame = ttk.Frame(window, padding=10) #frame.grid()