diff --git a/backend/evaluation_helper.py b/backend/evaluation_helper.py index f622ca2..57cf7ee 100644 --- a/backend/evaluation_helper.py +++ b/backend/evaluation_helper.py @@ -228,6 +228,9 @@ def batch_evaluate_activities( "errors": 0 } + # Track error details + error_details = [] + for activity in activities: activity_dict = dict(activity) try: @@ -246,7 +249,16 @@ def batch_evaluate_activities( except Exception as e: logger.error(f"[BATCH-EVAL] Error evaluating {activity_dict['id']}: {e}") + error_details.append({ + "activity_id": activity_dict['id'], + "training_type_id": activity_dict.get('training_type_id'), + "error": str(e) + }) stats["errors"] += 1 + # Add error details to stats (limit to first 10) + if error_details: + stats["error_details"] = error_details[:10] + logger.info(f"[BATCH-EVAL] Completed: {stats}") return stats