Merge pull request #12136 from Snuffleupagus/PDFFetchStreamRangeReader-AbortError
Ignore `fetch()` errors, in `PDFFetchStreamRangeReader`, once the request has been aborted
This commit is contained in:
commit
6537e64cb8
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user