mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
WebUI: Continue polling after network error
These `fetch` calls properly handle 4xx and 5xx errors, but don't handle network errors. In all cases, I've used the same logic as the `!response.ok` branch of each individual fetch function. This should ensure consistent behavior. PR #23164.
This commit is contained in:
committed by
GitHub
parent
4fa433a728
commit
ac31fe52e9
@@ -241,6 +241,10 @@ window.qBittorrent.AddTorrent ??= (() => {
|
||||
metadataCompleted();
|
||||
else
|
||||
loadMetadataTimer = loadMetadata.delay(1000);
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
|
||||
loadMetadataTimer = loadMetadata.delay(1000);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -234,6 +234,12 @@ window.qBittorrent.PropGeneral ??= (() => {
|
||||
}
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
loadTorrentDataTimer = loadTorrentData.delay(5000);
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
|
||||
document.getElementById("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
loadTorrentDataTimer = loadTorrentData.delay(10000);
|
||||
});
|
||||
|
||||
const pieceStatesURL = new URL("api/v2/torrents/pieceStates", window.location);
|
||||
@@ -262,6 +268,12 @@ window.qBittorrent.PropGeneral ??= (() => {
|
||||
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
loadTorrentDataTimer = loadTorrentData.delay(5000);
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
|
||||
document.getElementById("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
loadTorrentDataTimer = loadTorrentData.delay(10000);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -917,6 +917,11 @@ window.qBittorrent.Search ??= (() => {
|
||||
|
||||
clearTimeout(state.loadResultsTimer);
|
||||
state.loadResultsTimer = loadSearchResultsData.delay(2000, this, searchId);
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
|
||||
clearTimeout(state.loadResultsTimer);
|
||||
state.loadResultsTimer = loadSearchResultsData.delay(3000, this, searchId);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -416,6 +416,12 @@
|
||||
|
||||
tableInfo[curTab].progress = false;
|
||||
syncLogWithInterval(getSyncLogDataInterval());
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
|
||||
document.getElementById("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
|
||||
tableInfo[curTab].progress = false;
|
||||
syncLogWithInterval(10000);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user