From b24ddc5490566d043a521ad705f086f93edb65d6 Mon Sep 17 00:00:00 2001 From: RaymondVerhoef Date: Mon, 25 May 2026 19:35:52 +0200 Subject: [PATCH] fix --- src/lib/testService.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/testService.js b/src/lib/testService.js index 0bd3d0f..e0828f5 100644 --- a/src/lib/testService.js +++ b/src/lib/testService.js @@ -131,7 +131,14 @@ export async function forceGenerateTopicQuestions(topic, count = 5) { let candidates = null; for (let attempt = 0; attempt < 3; attempt++) { - const questions = await callQuizModel(topic, count); + let questions; + try { + questions = await callQuizModel(topic, count); + } catch (err) { + console.warn(`[quiz] LLM failed (attempt ${attempt + 1}):`, err.message); + lastQualityError = err.message; + continue; + } const qualityError = validateBatchQuality(questions); if (qualityError) {