geethareddy commited on
Commit
45329dc
·
verified ·
1 Parent(s): 0dca26d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -86,9 +86,9 @@ def get_food_suggestions():
86
  error_message = str(e)
87
  if "429" in error_message or "insufficient_quota" in error_message.lower():
88
  return jsonify({
89
- "error": f"Failed to get food suggestions: Error code: 429 - You exceeded your current OpenAI quota. Please upgrade your plan at https://platform.openai.com/account/billing or check the documentation at https://platform.openai.com/docs/guides/error-codes/api-errors."
90
  }), 429
91
- return jsonify({"error": f"Failed to get food suggestions: {error_message}. Please contact support if the issue persists."}), 500
92
 
93
  if __name__ == '__main__':
94
  app.run(debug=True, host='0.0.0.0', port=7860)
 
86
  error_message = str(e)
87
  if "429" in error_message or "insufficient_quota" in error_message.lower():
88
  return jsonify({
89
+ "error": "Unable to get recipe ideas. HTTP error! Status: 429. You exceeded your current OpenAI quota. Please upgrade your plan at https://platform.openai.com/account/billing or check the documentation at https://platform.openai.com/docs/guides/error-codes/api-errors."
90
  }), 429
91
+ return jsonify({"error": f"Unable to get recipe ideas. {error_message}. Please contact support if the issue persists."}), 500
92
 
93
  if __name__ == '__main__':
94
  app.run(debug=True, host='0.0.0.0', port=7860)