Merge pull request #12136 from Snuffleupagus/PDFFetchStreamRangeReader-AbortError

Ignore `fetch()` errors, in `PDFFetchStreamRangeReader`, once the request has been aborted
This commit is contained in:
Tim van der Meij 2020-07-29 00:09:51 +02:00 committed by GitHub
commit 6537e64cb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,13 +243,20 @@ class PDFFetchStreamRangeReader {
this._withCredentials,
this._abortController
)
).then(response => {
if (!validateResponseStatus(response.status)) {
throw createResponseStatusError(response.status, url);
}
this._readCapability.resolve();
this._reader = response.body.getReader();
});
)
.then(response => {
if (!validateResponseStatus(response.status)) {
throw createResponseStatusError(response.status, url);
}
this._readCapability.resolve();
this._reader = response.body.getReader();
})
.catch(reason => {
if (reason && reason.name === "AbortError") {
return;
}
throw reason;
});
this.onProgress = null;
}