mirror of
https://github.com/thelounge/thelounge
synced 2024-11-25 05:20:21 +00:00
Serve requests from cache when server responds with non 2xx response
This commit is contained in:
parent
2a1e711f42
commit
cb59681cd9
1 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,11 @@ function networkOrCache(uri) {
|
|||
return response;
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Request for ${uri.href} failed with HTTP ${response.status}`);
|
||||
|
||||
return Promise.reject("request-failed");
|
||||
})
|
||||
.catch(function() {
|
||||
return cache.match(uri).then(function(matching) {
|
||||
|
|
Loading…
Reference in a new issue