diff --git a/custom_addons/encoach_ai/controllers/__pycache__/ai_controller.cpython-312.pyc b/custom_addons/encoach_ai/controllers/__pycache__/ai_controller.cpython-312.pyc index b9271a17..c74c0be2 100644 Binary files a/custom_addons/encoach_ai/controllers/__pycache__/ai_controller.cpython-312.pyc and b/custom_addons/encoach_ai/controllers/__pycache__/ai_controller.cpython-312.pyc differ diff --git a/custom_addons/encoach_ai/controllers/ai_controller.py b/custom_addons/encoach_ai/controllers/ai_controller.py index cc326aca..7f41dbcf 100644 --- a/custom_addons/encoach_ai/controllers/ai_controller.py +++ b/custom_addons/encoach_ai/controllers/ai_controller.py @@ -347,7 +347,8 @@ class AIController(http.Controller): ] return _json_response(ai.chat_json(messages, action=f"exam_generate_{module}")) except Exception as e: - return _json_response({"questions": [], "error": str(e)}) + _logger.exception("exam_generate %s failed: %s", module, e) + return _json_response({"questions": [], "error": str(e)}, 500) def _generate_passage(self, ai, body): topic = body.get("topic", "general knowledge")