Edwin Salguero commited on
Commit ·
081f523
1
Parent(s): 22dd4c3
Add error handling and debug logging for AWS client initialization to prevent UnboundLocalError
Browse files437 unmodified lines438439440441442443444445437 unmodified linesst.stop()# Initialize AWS clients and config for real data modes3_client, lambda_client = init_aws_clients()config = load_app_config()# Force analytics to be available if loading succeededif ANALYTICS_AVAILABLE:437 unmodified lines438439440441442443444445446447448449450451452453454455456457458459460437 unmodified linesst.stop()# Initialize AWS clients and config for real data modetry:s3_client, lambda_client = init_aws_clients()print(f"DEBUG: AWS clients initialized - s3_client: {s3_client is not None}, lambda_client: {lambda_client is not None}")except Exception as e:print(f"DEBUG: Failed to initialize AWS clients: {e}")s3_client, lambda_client = None, Nonetry:config = load_app_config()print(f"DEBUG: App config loaded: {config}")except Exception as e:print(f"DEBUG: Failed to load app config: {e}")config = {'s3_bucket': 'fredmlv1','lambda_function': 'fred-ml-processor','api_endpoint': 'http://localhost:8000'}# Force analytics to be available if loading succeededif ANALYTICS_AVAILABLE:
frontend/app.py+17-2