From 8a59353d48875d4b5a6190a478c5622bafdb22e8 Mon Sep 17 00:00:00 2001 From: Stalin <161853795+0x5t4l1n@users.noreply.github.com> Date: Thu, 16 Jul 2026 10:09:22 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 92: Information exposure through an exception Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- backend/routes/quizzes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/routes/quizzes.py b/backend/routes/quizzes.py index 2ab05c2..bd77dd1 100644 --- a/backend/routes/quizzes.py +++ b/backend/routes/quizzes.py @@ -602,7 +602,7 @@ def generate_ai_quiz(): except Exception as e: print(f"❌ AI generation error: {str(e)}") - return jsonify({"success": False, "error": str(e)}), 500 + return jsonify({"success": False, "error": "An internal error has occurred."}), 500 @bp.route('/room//generate-ai-questions', methods=['POST', 'OPTIONS']) def generate_ai_questions(room_code): @@ -734,7 +734,7 @@ def generate_ai_questions(room_code): except Exception as e: print(f"❌ AI generation error: {str(e)}") - return jsonify({"success": False, "error": str(e)}), 500 + return jsonify({"success": False, "error": "An internal error has occurred."}), 500 # =================================================================== # ✅ DEBUG ENDPOINT FOR TROUBLESHOOTING