Skip to content

fix(pptPreview): return error result instead of throwing in provider callback#1731

Merged
piorpua merged 1 commit intomainfrom
fix/sentry-ELECTRON-CT
Mar 26, 2026
Merged

fix(pptPreview): return error result instead of throwing in provider callback#1731
piorpua merged 1 commit intomainfrom
fix/sentry-ELECTRON-CT

Conversation

@kaizhou-lab
Copy link
Copy Markdown
Collaborator

Summary

  • Return { url: '', error } instead of re-throwing in pptPreview.start provider callback
  • Add error field check in PptViewer renderer before using the URL
  • Update tests to expect resolved error results instead of rejections

Sentry: ELECTRON-CT — 144 events

Closes #1730

Verification

  • Unit tests pass: all 18 pptPreviewBridge tests green
  • Process: main (spawn/IPC) — unit tests are primary verification

Test plan

  • bun run test tests/unit/pptPreviewBridge.test.ts — 18/18 pass
  • bunx tsc --noEmit passes
  • Lint and format clean

…callback

The bridge subscribe() function lacks .catch(), so errors thrown from provider
callbacks become unhandled promise rejections (Sentry ELECTRON-CT, 144 events).
Return { url: '', error: message } instead of re-throwing, and check for the
error field in the renderer before using the URL.

Fixes ELECTRON-CT
@kaizhou-lab kaizhou-lab marked this pull request as ready for review March 26, 2026 03:37
@piorpua piorpua merged commit 2de2baf into main Mar 26, 2026
17 checks passed
@piorpua piorpua deleted the fix/sentry-ELECTRON-CT branch March 26, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: prevent unhandled promise rejection in pptPreview provider (ELECTRON-CT)

2 participants