mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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
1 changed files with 14 additions and 7 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue