feat: add error_details to batch evaluation response
Some checks failed
Build Test / lint-backend (push) Waiting to run
Build Test / build-frontend (push) Waiting to run
Deploy Development / deploy (push) Has been cancelled

- Shows first 10 errors with activity_id, training_type_id, and error message
- Helps debug evaluation failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-23 13:24:14 +01:00
parent 41c7084159
commit 33e27a4f3e

View File

@ -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