Improve failed ETag error message [#427] (#428)

* Improve failed ETag error message [#427]
This commit is contained in:
Brandon Liu
2024-07-25 11:14:26 +08:00
committed by GitHub
parent 0f9009e70e
commit a7c76e03e5

View File

@@ -407,7 +407,9 @@ export class FetchSource implements Source {
// some storage systems are misbehaved (Cloudflare R2) // some storage systems are misbehaved (Cloudflare R2)
if (resp.status === 416 || (etag && newEtag && newEtag !== etag)) { if (resp.status === 416 || (etag && newEtag && newEtag !== etag)) {
this.mustReload = true; this.mustReload = true;
throw new EtagMismatch(etag); throw new EtagMismatch(
`Server returned non-matching ETag ${etag} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`
);
} }
if (resp.status >= 300) { if (resp.status >= 300) {