DataExpert-io / data-engineer-handbook

This is a repo with links to everything you'd ever want to learn about data engineering

Repository from Github https://github.comDataExpert-io/data-engineer-handbookRepository from Github https://github.comDataExpert-io/data-engineer-handbook

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 here

Hey, is someone picking this up or is it free to be worked on?