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

@xy200303 xy200303 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

codecov-commenter commented Jun 5, 2026

Copy link
Copy Markdown

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!

@caio-pizzol caio-pizzol left a comment

Copy link
Copy Markdown
Contributor

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
@superdoc-bot

superdoc-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-cli v0.17.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-sdk v1.16.0

@superdoc-bot

superdoc-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/mcp v0.12.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc v1.40.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/react v1.11.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in vscode-ext v2.12.0

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