From 867382f9b2eb3a4e95b47b3eb6a1af37a90d631e Mon Sep 17 00:00:00 2001 From: Johann Schopplich Date: Tue, 25 Jun 2024 10:05:04 +0200 Subject: [PATCH] feat: log errors from PDF.js package (related to #14) --- src/utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 8a23e05..1aa2202 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -59,7 +59,8 @@ export async function resolvePDFJSImports( } return; - } catch { + } catch (error) { + console.error(error); throw new Error( "Resolving failed. Please check the provided configuration.", ); @@ -71,7 +72,8 @@ export async function resolvePDFJSImports( const { resolvePDFJS } = await import("unpdf/pdfjs"); // @ts-ignore: Type mismatch resolvedModule = await resolvePDFJS(); - } catch { + } catch (error) { + console.error(error); throw new Error( "PDF.js is not available. Please add the package as a dependency.", );