From 792c53b2561e476f2ef2a497b2c83e67d08e2c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sun, 24 Nov 2024 12:07:00 -0500 Subject: [PATCH] Replace another fatal error with a clearer message --- settings.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index 504fe8c..4f04601 100644 --- a/settings.py +++ b/settings.py @@ -3,6 +3,7 @@ import configparser import json import os +import sys config = configparser.ConfigParser() config['pomodoro'] = {} @@ -47,4 +48,7 @@ def harvest_set_projects_clients_map(projects_clients_map = {}): write() def harvest_get_projects_clients_map(): - return json.loads(harvest['projects_clients']) + if 'projects_clients' in harvest: + return json.loads(harvest['projects_clients']) + else: + sys.exit("No project clients available; run fetch_clients_projects.py")