From 1d1a8887d49db5339aa3cb917f860452b7ffb7b2 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Mon, 10 Apr 2023 12:19:49 +0200 Subject: improved error handling --- py/utils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'py/utils.py') diff --git a/py/utils.py b/py/utils.py index dee7d42..2291a26 100644 --- a/py/utils.py +++ b/py/utils.py @@ -9,6 +9,8 @@ def load_api_key(): api_key = file.read() except Exception: pass + if not api_key: + raise Exception("Missing OpenAI API key") return api_key.strip() def make_request_options(options): -- cgit v1.2.3