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
+4 -4
View File
@@ -618,7 +618,7 @@ vv_ai_chat_markup('vv-ai', [
function loadBanner(live) {
fetch(API + '?action=stats' + (live ? '&live=1' : '')).then(r => r.json())
.then(d => { if (d.ok) renderBanner(d.stats); })
.catch(() => {});
.catch(e => vvFetchErr('AI banner', e));
}
// ── Bug reports ─────────────────────────────────────────────────────────
@@ -628,7 +628,7 @@ vv_ai_chat_markup('vv-ai', [
function loadBugs() {
fetch(API + '?action=bugs').then(r => r.json())
.then(d => { if (d.ok) renderBugs(d.bugs || []); })
.catch(() => {});
.catch(e => vvFetchErr('AI bug list', e));
}
function renderBugs(bugs) {
@@ -750,7 +750,7 @@ vv_ai_chat_markup('vv-ai', [
fetch(API, { method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
body: new URLSearchParams({ action: 'bug_close', id, open: '0' }) })
.then(() => loadBugs()).catch(() => {});
.then(() => loadBugs()).catch(e => vvFetchErr('AI bug report', e));
};
// ── Findings & proposals ────────────────────────────────────────────────
@@ -1108,7 +1108,7 @@ vv_ai_chat_markup('vv-ai', [
function loadTokens() {
fetch(API + '?action=tokens').then(r => r.json())
.then(d => { if (d.ok) { tokData = d.tokens; renderTokens(); } })
.catch(() => {});
.catch(e => vvFetchErr('AI token ledger', e));
}
function renderTokens() {
+2 -2
View File
@@ -2087,7 +2087,7 @@ function vvLoadTokens() {
return fetch('/plugins/varaverk/api/ai.php?action=tokens')
.then(r => r.json())
.then(d => { if (d.ok) { vvTokData = d.tokens; vvRenderTokens(); } })
.catch(() => {});
.catch(e => vvFetchErr('token ledger', e));
}
function vvRenderTokens() {
@@ -2522,7 +2522,7 @@ function vvPollStreams() {
}
vvRenderStreams();
})
.catch(() => {});
.catch(e => vvFetchErr('media streams', e));
}
// An unreachable partner is stated, never folded into the totals as zero. "Nobody is watching
+1 -1
View File
@@ -1274,7 +1274,7 @@ function vvPtLoad() {
fetch('/plugins/varaverk/api/partnership.php')
.then(r => r.json())
.then(_render)
.catch(() => {});
.catch(e => vvFetchErr('partnership status', e));
}
_vvPtReload = vvPtLoad; // expose to top-level toggle fns
+6 -6
View File
@@ -1074,7 +1074,7 @@ function vvRyLoad() {
fetch('/plugins/varaverk/api/rsync.php')
.then(r => r.json())
.then(_render)
.catch(() => {});
.catch(e => vvFetchErr('rsync config', e));
}
vvRyLoad();
@@ -1499,7 +1499,7 @@ function vvRpLoad() {
_vvRpFillForm(_vvRpSelected);
}
})
.catch(() => {});
.catch(e => vvFetchErr('rsync profiles', e));
}
function _vvRpPopulateSelector() {
@@ -1656,7 +1656,7 @@ function vvMsStop() {
fetch('/plugins/varaverk/api/manual_sync.php', { method: 'POST', body: fd })
.then(r => r.json())
.then(() => {})
.catch(() => {})
.catch(e => vvFetchErr('manual sync start', e))
.finally(() => { btn.textContent = '■ Stop'; btn.disabled = false; });
}
@@ -2018,7 +2018,7 @@ function _vvMsStartPoll(token, btn, stat, out, badge, stopBtn) {
setTimeout(() => { badge.style.display = 'none'; stat.textContent = ''; }, 6000);
}
})
.catch(() => {});
.catch(e => vvFetchErr('manual sync poll', e));
}, 1500);
}
@@ -2039,7 +2039,7 @@ function vvMsLoadRecent() {
fetch(_MS_API + '?action=recent')
.then(r => r.json())
.then(d => { _vvMsRecent = (d && d.rows) || []; _msRenderRecent(); })
.catch(() => {});
.catch(e => vvFetchErr('recent syncs', e));
}
function _msRenderRecent() {
@@ -2098,7 +2098,7 @@ document.addEventListener('click', async ev => {
body: new URLSearchParams(body) })
.then(r => r.json())
.then(() => vvMsLoadRecent())
.catch(() => {});
.catch(e => vvFetchErr('manual sync action', e));
});
// Fills the form and stops. Deliberately does not run: one click away from a transfer that may
+2 -2
View File
@@ -1567,7 +1567,7 @@ function vvPollStatus() {
}
vvRunningSet = nowRunning;
})
.catch(() => {});
.catch(e => vvFetchErr('job status', e));
}
function vvStartStatusPoll() {
@@ -2785,7 +2785,7 @@ function vvBoardPoll() {
vvUpdateErrors(d.errors ?? []);
vvUpdatePartner(d.partner);
})
.catch(() => {});
.catch(e => vvFetchErr('script board', e));
}
function vvUpdateLocks(locks) {
+1 -1
View File
@@ -662,7 +662,7 @@ function vvStartPhase2Watch(sinceMs) {
const done = (d.items || []).some(i => i.id === 'partnership' && i.ok);
if (done || Date.now() > deadline) stop();
})
.catch(() => {});
.catch(e => vvFetchErr('setup checklist', e));
};
// Redraw between checklist polls so the elapsed counter moves. Without it the panel is static