kopia lustrzana https://gitlab.com/rysiekpl/libresilient
clarifying comment in alt-fetch plugin code
rodzic
2406bca941
commit
f5facd288a
|
@ -105,6 +105,10 @@
|
||||||
))
|
))
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// 4xx? 5xx? that's a paddlin'
|
// 4xx? 5xx? that's a paddlin'
|
||||||
|
// NOTICE: normally 4xx errors are returned to the client by other plugins,
|
||||||
|
// NOTICE: but here we are relying on multiple alternative endpoints;
|
||||||
|
// NOTICE: so, we want to maximize the chance that we get *something* useful
|
||||||
|
// TODO: shouldn't this reject() instead
|
||||||
if (response.status >= 400) {
|
if (response.status >= 400) {
|
||||||
// throw an Error to fall back to other plugins:
|
// throw an Error to fall back to other plugins:
|
||||||
throw new Error('HTTP Error: ' + response.status + ' ' + response.statusText);
|
throw new Error('HTTP Error: ' + response.status + ' ' + response.statusText);
|
||||||
|
|
Ładowanie…
Reference in New Issue