File tree 2 files changed +4
-11
lines changed
2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ class ChunkedStreamManager {
290
290
291
291
let chunks = [ ] ,
292
292
loaded = 0 ;
293
- const promise = new Promise ( ( resolve , reject ) => {
293
+ return new Promise ( ( resolve , reject ) => {
294
294
const readChunk = chunk => {
295
295
try {
296
296
if ( ! chunk . done ) {
@@ -311,14 +311,12 @@ class ChunkedStreamManager {
311
311
}
312
312
} ;
313
313
rangeReader . read ( ) . then ( readChunk , reject ) ;
314
- } ) ;
315
- promise . then ( data => {
314
+ } ) . then ( data => {
316
315
if ( this . aborted ) {
317
316
return ; // Ignoring any data after abort.
318
317
}
319
318
this . onReceiveData ( { chunk : data , begin } ) ;
320
319
} ) ;
321
- // TODO check errors
322
320
}
323
321
324
322
/**
@@ -369,7 +367,7 @@ class ChunkedStreamManager {
369
367
groupedChunk . endChunk * this . chunkSize ,
370
368
this . length
371
369
) ;
372
- this . sendRequest ( begin , end ) ;
370
+ this . sendRequest ( begin , end ) . catch ( capability . reject ) ;
373
371
}
374
372
}
375
373
Original file line number Diff line number Diff line change @@ -247,12 +247,7 @@ class PDFFetchStreamRangeReader {
247
247
this . _readCapability . resolve ( ) ;
248
248
this . _reader = response . body . getReader ( ) ;
249
249
} )
250
- . catch ( reason => {
251
- if ( reason ?. name === "AbortError" ) {
252
- return ;
253
- }
254
- throw reason ;
255
- } ) ;
250
+ . catch ( this . _readCapability . reject ) ;
256
251
257
252
this . onProgress = null ;
258
253
}
You can’t perform that action at this time.
0 commit comments