From 83088e1e15678a2e8c76d6d40f78b633636eb878 Mon Sep 17 00:00:00 2001 From: Jonas Hess <JonasHess@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:56:49 +0200 Subject: [PATCH] Specific error messages for missing environment variables (#21) --- main.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 387c911..30e1816 100644 --- a/main.go +++ b/main.go @@ -60,12 +60,20 @@ Be very selective and only choose the most relevant tags since too many tags wil ) func main() { - if paperlessBaseURL == "" || paperlessAPIToken == "" { - log.Fatal("Please set the PAPERLESS_BASE_URL and PAPERLESS_API_TOKEN environment variables.") + if paperlessBaseURL == "" { + log.Fatal("Please set the PAPERLESS_BASE_URL environment variable.") } - if llmProvider == "" || llmModel == "" { - log.Fatal("Please set the LLM_PROVIDER and LLM_MODEL environment variables.") + if paperlessAPIToken == "" { + log.Fatal("Please set the PAPERLESS_API_TOKEN environment variable.") + } + + if llmProvider == "" { + log.Fatal("Please set the LLM_PROVIDER environment variable.") + } + + if llmModel == "" { + log.Fatal("Please set the LLM_MODEL environment variable.") } if llmProvider == "openai" && openaiAPIKey == "" {