CCockrum commited on
Commit
eb0e697
·
verified ·
1 Parent(s): 9e02f8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -152,8 +152,10 @@ def stock_research(symbol, assumed_eps=5.0, growth_rate=0.1, book_value=50000000
152
  dividends = get_dividends(symbol)
153
  dates, prices = get_historical_prices(symbol)
154
 
155
- if not info or not price:
156
- return "Error fetching stock information.", None, None, None, None, None
 
 
157
 
158
  ratios = calculate_ratios(info['Market Cap'], info['Total Revenue'], price, dividends['Dividend Amount'], assumed_eps, growth_rate, book_value)
159
  summary = generate_summary(info, ratios)
 
152
  dividends = get_dividends(symbol)
153
  dates, prices = get_historical_prices(symbol)
154
 
155
+ if not info:
156
+ return "⚠️ Error: Could not fetch company information. Please check your API Key or ticker.", None, None, None, None, None
157
+ if not price:
158
+ return "⚠️ Error: Could not fetch current stock price. Please check your API Key or ticker.", None, None, None, None, None
159
 
160
  ratios = calculate_ratios(info['Market Cap'], info['Total Revenue'], price, dividends['Dividend Amount'], assumed_eps, growth_rate, book_value)
161
  summary = generate_summary(info, ratios)