Issue 1: Missing error handling for Statsig initialization
PrinceSajjadHussain opened this issue · comments
The statsig.initialize(API_KEY) call in server.py does not have any error handling. If API_KEY is not set or is invalid, statsig.initialize could fail, causing the entire application to crash. A try-except block should be used to catch any exceptions thrown during initialization and handle them gracefully, possibly by logging an error and exiting or using a default configuration.
API_KEY = os.environ.get('STATSIG_API_KEY')
try:
statsig.initialize(API_KEY)
except Exception as e:
print(f"Failed to initialize Statsig: {e}")
# Potentially exit or use a default config hereHey, is someone picking this up or is it free to be worked on?