@heripo/pdf-parser 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3571,14 +3571,32 @@ var PDFConverter = class {
3571
3571
  },
3572
3572
  this.timeout
3573
3573
  );
3574
- return chunked.convertChunked(
3575
- url,
3576
- reportId,
3577
- onComplete,
3578
- cleanupAfterCallback,
3579
- options,
3580
- abortSignal
3581
- );
3574
+ try {
3575
+ return await chunked.convertChunked(
3576
+ url,
3577
+ reportId,
3578
+ onComplete,
3579
+ cleanupAfterCallback,
3580
+ options,
3581
+ abortSignal
3582
+ );
3583
+ } catch (error) {
3584
+ if (error instanceof Error && error.name === "AbortError") {
3585
+ throw error;
3586
+ }
3587
+ this.logger.warn(
3588
+ "[PDFConverter] Chunked conversion failed, retrying with image-based PDF...",
3589
+ error instanceof Error ? error.message : error
3590
+ );
3591
+ return this.convertViaImagePdf(
3592
+ url,
3593
+ reportId,
3594
+ onComplete,
3595
+ cleanupAfterCallback,
3596
+ options,
3597
+ abortSignal
3598
+ );
3599
+ }
3582
3600
  }
3583
3601
  if (options.forceImagePdf) {
3584
3602
  return this.convertViaImagePdf(