pdfjs-reader-core 0.2.9 → 0.2.10

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.cjs CHANGED
@@ -4737,7 +4737,11 @@ var init_ThumbnailPanel = __esm({
4737
4737
  }
4738
4738
  } catch (error) {
4739
4739
  if (!cancelled) {
4740
- console.error(`Error rendering thumbnail for page ${pageNumber}:`, error);
4740
+ const errorMessage = error instanceof Error ? error.message : String(error);
4741
+ const isDocumentDestroyed = errorMessage.includes("destroyed") || errorMessage.includes("sendWithStream") || errorMessage.includes("sendWithPromise") || errorMessage.includes("Cannot read properties of null");
4742
+ if (!isDocumentDestroyed) {
4743
+ console.error(`Error rendering thumbnail for page ${pageNumber}:`, error);
4744
+ }
4741
4745
  }
4742
4746
  }
4743
4747
  };
@@ -8457,7 +8461,8 @@ var init_DocumentContainer = __esm({
8457
8461
  } catch (error) {
8458
8462
  if (!cancelled) {
8459
8463
  const errorMessage = error instanceof Error ? error.message : String(error);
8460
- if (!errorMessage.includes("destroyed") && !errorMessage.includes("sendWithStream")) {
8464
+ const isDocumentDestroyed = errorMessage.includes("destroyed") || errorMessage.includes("sendWithStream") || errorMessage.includes("sendWithPromise") || errorMessage.includes("Cannot read properties of null");
8465
+ if (!isDocumentDestroyed) {
8461
8466
  console.error("Error loading page:", error);
8462
8467
  }
8463
8468
  }
@@ -8736,7 +8741,11 @@ var init_VirtualizedDocumentContainer = __esm({
8736
8741
  newPageObjects.set(pageNum, page);
8737
8742
  hasChanges = true;
8738
8743
  } catch (error) {
8739
- console.error(`Error loading page ${pageNum}:`, error);
8744
+ const errorMessage = error instanceof Error ? error.message : String(error);
8745
+ const isDocumentDestroyed = errorMessage.includes("destroyed") || errorMessage.includes("sendWithStream") || errorMessage.includes("sendWithPromise") || errorMessage.includes("Cannot read properties of null");
8746
+ if (!isDocumentDestroyed) {
8747
+ console.error(`Error loading page ${pageNum}:`, error);
8748
+ }
8740
8749
  }
8741
8750
  }
8742
8751
  }
@@ -9114,7 +9123,11 @@ var init_DualPageContainer = __esm({
9114
9123
  }
9115
9124
  } catch (error) {
9116
9125
  if (!cancelled) {
9117
- console.error("Error loading pages:", error);
9126
+ const errorMessage = error instanceof Error ? error.message : String(error);
9127
+ const isDocumentDestroyed = errorMessage.includes("destroyed") || errorMessage.includes("sendWithStream") || errorMessage.includes("sendWithPromise") || errorMessage.includes("Cannot read properties of null");
9128
+ if (!isDocumentDestroyed) {
9129
+ console.error("Error loading pages:", error);
9130
+ }
9118
9131
  }
9119
9132
  } finally {
9120
9133
  if (!cancelled) {
@@ -11750,7 +11763,11 @@ var PDFThumbnailNav = (0, import_react51.memo)(function PDFThumbnailNav2({
11750
11763
  });
11751
11764
  }
11752
11765
  } catch (error) {
11753
- console.error(`Failed to render thumbnail for page ${pageNum}:`, error);
11766
+ const errorMessage = error instanceof Error ? error.message : String(error);
11767
+ const isDocumentDestroyed = errorMessage.includes("destroyed") || errorMessage.includes("sendWithStream") || errorMessage.includes("sendWithPromise") || errorMessage.includes("Cannot read properties of null");
11768
+ if (!isDocumentDestroyed) {
11769
+ console.error(`Failed to render thumbnail for page ${pageNum}:`, error);
11770
+ }
11754
11771
  } finally {
11755
11772
  renderQueueRef.current.delete(pageNum);
11756
11773
  }