Skip to content

fix(super-editor): rethrow export docx errors#3641

Merged
caio-pizzol merged 3 commits into
superdoc-dev:mainfrom
xy200303:fix/export-docx-rethrow
Jun 6, 2026
Merged

fix(super-editor): rethrow export docx errors#3641
caio-pizzol merged 3 commits into
superdoc-dev:mainfrom
xy200303:fix/export-docx-rethrow

Conversation

@xy200303
Copy link
Copy Markdown
Contributor

@xy200303 xy200303 commented Jun 5, 2026

Summary

  • Re-throw normalized Editor.exportDocx() errors after preserving the existing exception event and console logging.
  • Remove undefined from the internal implementation return union.
  • Add a regression test that verifies failed converter.exportToDocx calls reject to the caller.

Verification

  • pnpm test:editor -- src/editors/v1/tests/export/exportDocx.errors.test.js
  • pnpm test:editor -- src/editors/v1/tests/export/exportDocx.errors.test.js src/editors/v1/tests/export/exportDocx.commentsFallback.test.js
  • pnpm --prefix packages/super-editor run types:check (fails: existing unresolved @superdoc/font-system declarations and broad pre-existing JS/TS errors)

Closes #3579

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/superdoc/src/core/SuperDoc.ts 93.75% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xy200303 thanks for the fix. I pushed a follow-up commit that covers the SuperDoc wrapper path and avoids duplicate export exception events.

The added coverage checks that a rejected editor export falls back to the original DOCX data, sibling documents still export, and a bridged editor exception does not cause a second wrapper exception.

I only ran git diff --check; local unit tests were not run because this repo asks us not to run them locally. CI is queued.

lgtm.

@caio-pizzol caio-pizzol merged commit 35c7959 into superdoc-dev:main Jun 6, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor.exportDocx() swallows export errors — catch returns undefined instead of rethrowing

3 participants