config loading errors done

master
BodgeMaster 2022-02-14 13:34:52 +01:00
parent d34b1f5b35
commit a38e38f96e
1 changed files with 5 additions and 4 deletions

View File

@ -89,9 +89,8 @@ if os.path.isfile(config_file_path):
config_file = open(config_file_path, "r") config_file = open(config_file_path, "r")
configuration = json.loads(config_file.read()) configuration = json.loads(config_file.read())
config_file.close() config_file.close()
except: except Exception:
#TODO: show an error message error("An exception occurred while trying to load the configuration.", handle_gracefully=False)
warn("Not implemented!")
else: else:
# config not found # config not found
dialog_interaction_handler = Window_Interaction_Handler() dialog_interaction_handler = Window_Interaction_Handler()
@ -109,9 +108,11 @@ else:
#TODO: store default configuration #TODO: store default configuration
warn("Not implemented!") warn("Not implemented!")
else: 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) sys.exit(EXIT_SUCCESS)
#window = tk.Tk() #window = tk.Tk()
#frame = ttk.Frame(window, padding=10) #frame = ttk.Frame(window, padding=10)
#frame.grid() #frame.grid()