From adbab5fe22e0c62025010af873df36e1cb62e5ad Mon Sep 17 00:00:00 2001 From: Carl Brugger Date: Wed, 6 Mar 2024 19:12:29 -0600 Subject: [PATCH] fix: excel extractor password protected error messaging --- .changeset/giant-countries-brush.md | 5 +++++ plugins/xlsx-extractor/src/parser.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/giant-countries-brush.md diff --git a/.changeset/giant-countries-brush.md b/.changeset/giant-countries-brush.md new file mode 100644 index 000000000..fab2dd324 --- /dev/null +++ b/.changeset/giant-countries-brush.md @@ -0,0 +1,5 @@ +--- +'@flatfile/plugin-xlsx-extractor': patch +--- + +This release improves the error messaging when extracting password-protected Excel files diff --git a/plugins/xlsx-extractor/src/parser.ts b/plugins/xlsx-extractor/src/parser.ts index d2cfeeb40..1fe70622a 100644 --- a/plugins/xlsx-extractor/src/parser.ts +++ b/plugins/xlsx-extractor/src/parser.ts @@ -38,6 +38,8 @@ export async function parseBuffer( throw new Error( 'File is too large to parse. Try converting this file to CSV.' ) + } else if (e.message === 'File is password-protected') { + throw new Error('File is password-protected') } }