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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user