mirror of
https://github.com/aljazceru/IngestRSS.git
synced 2025-12-17 14:04:19 +01:00
additional error logging for no env vars.
This commit is contained in:
@@ -8,6 +8,7 @@ from src.infra.lambdas.RSSQueueFiller.deploy_sqs_filler_lambda import deploy_sqs
|
|||||||
|
|
||||||
from src.utils.check_env import check_env
|
from src.utils.check_env import check_env
|
||||||
|
|
||||||
|
print("🗞️💵⚖️IngestRSS🗞️💵⚖️\n".ljust(10, "-").rjust(10, "-"))
|
||||||
|
|
||||||
load_dotenv(override=True)
|
load_dotenv(override=True)
|
||||||
check_env()
|
check_env()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import time
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
|
|
||||||
@@ -85,10 +86,21 @@ def check_env() -> None:
|
|||||||
for var in missing_optional_vars:
|
for var in missing_optional_vars:
|
||||||
print(f"- {var}")
|
print(f"- {var}")
|
||||||
|
|
||||||
print("\nPlease set these environment variables before running the script.")
|
|
||||||
|
print(f"😡👊😡Someone didn't read DIRECTIONS 😡👊😡")
|
||||||
|
time.sleep(0.5)
|
||||||
|
print("That's okay.")
|
||||||
|
time.sleep(0.2)
|
||||||
|
print("I don't follow directions that much either. We're in the same boat.")
|
||||||
|
|
||||||
|
time.sleep(0.5)
|
||||||
|
print("But we need to set these environment variables before running the script.")
|
||||||
|
|
||||||
|
print("\nPlease refer to the README & template.env for additional setup instructions.")
|
||||||
raise EnvironmentError("Missing or improperly set environment variables")
|
raise EnvironmentError("Missing or improperly set environment variables")
|
||||||
else:
|
else:
|
||||||
print("All required environment variables are properly set.")
|
print("Someone followed directions!🐝🐝🐝")
|
||||||
|
print("All required environment variables are properly set. P")
|
||||||
|
|
||||||
# Example usage
|
# Example usage
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user