From ad633edefdba3a1cbd3224ce49b338a815e58672 Mon Sep 17 00:00:00 2001 From: Jake Pullen Date: Sat, 10 Aug 2024 13:26:02 +0100 Subject: [PATCH] added check for present api toen and budget id --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index 8ebc54d..f850ff2 100644 --- a/main.py +++ b/main.py @@ -13,6 +13,9 @@ dotenv.load_dotenv() API_TOKEN = os.getenv('API_TOKEN') BUDGET_ID = os.getenv('BUDGET_ID') logging.basicConfig(level=logging.DEBUG) +if not API_TOKEN or not BUDGET_ID: + logging.error('API_TOKEN or BUDGET_ID is not set in .env file') + exit(1) with open('config.yaml', 'r') as file: config = yaml.safe_load(file)