Report every failed fetch instead of discarding it

Twenty-four fetch chains ended in an empty catch, which is not error handling
but error deletion: the request fails, nothing renders, nothing is logged, and
the surface sits on Loading forever. That is how the mesh chat's ReferenceError
read as a slow load for as long as it did.
This commit is contained in:
Gmer4Lfe
2026-08-21 09:23:51 -04:00
parent 906375dc23
commit 146be2d0ad
9 changed files with 55 additions and 24 deletions
+7 -7
View File
@@ -1440,7 +1440,7 @@ vv_ai_profiles_script();
fetch(API, { method: 'POST', headers: POST_HEAD,
body: new URLSearchParams({ action: 'stop', token: t }) })
.then(r => r.json())
.catch(() => {});
.catch(e => vvFetchErr('stop generation', e));
// Nothing is rendered from the response. The poll already owns turning a terminal state into
// a message, and having two paths do it is how a turn ends up in the transcript twice.
}
@@ -1465,7 +1465,7 @@ vv_ai_profiles_script();
noteLine('Stopped before anything was written.');
}
fetch(API, { method: 'POST', headers: POST_HEAD,
body: new URLSearchParams({ action: 'clear', token }) }).catch(() => {});
body: new URLSearchParams({ action: 'clear', token }) }).catch(e => vvFetchErr('clear job', e));
finish();
save();
return;
@@ -1475,7 +1475,7 @@ vv_ai_profiles_script();
addAnswer(j);
messages.push({ role: 'assistant', content: j.answer });
fetch(API, { method: 'POST', headers: POST_HEAD,
body: new URLSearchParams({ action: 'clear', token }) }).catch(() => {});
body: new URLSearchParams({ action: 'clear', token }) }).catch(e => vvFetchErr('clear job', e));
finish();
save();
// The answer is passed so a page can react to what was said, not just that a turn
@@ -1519,7 +1519,7 @@ vv_ai_profiles_script();
}) })
.then(r => r.json())
.then(d => { if (d.ok) { chatId = d.id; onChats(chatId); } })
.catch(() => {});
.catch(e => vvFetchErr('save conversation', e));
}
@@ -2121,7 +2121,7 @@ vv_ai_profiles_script();
const last = pool.slice().sort((a, b) => (b.updated || 0) - (a.updated || 0))[0];
if (last) loadChat(last.id);
}).catch(() => {});
}).catch(e => vvFetchErr('resume conversation', e));
}
const inst = {
@@ -2305,7 +2305,7 @@ vv_ai_profiles_script();
function load() {
fetch(API + '?action=chats').then(r => r.json())
.then(d => { if (d.ok) { rows = d.chats || []; render(); } })
.catch(() => {});
.catch(e => vvFetchErr('conversation list', e));
}
box.addEventListener('click', e => {
@@ -2328,7 +2328,7 @@ vv_ai_profiles_script();
// from the store, which would silently resurrect it on the next turn.
if (del.dataset.del === activeId && o.chat) o.chat.newChat();
load();
}).catch(() => {});
}).catch(e => vvFetchErr('delete conversation', e));
return;
}
const row = e.target.closest('.vv-ai-crow');