Specific error messages for missing environment variables (#21)

This commit is contained in:
Jonas Hess 2024-10-21 09:56:49 +02:00 committed by GitHub
parent d1e990ff4b
commit 83088e1e15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

16
main.go
View file

@ -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 == "" {