Skip to content

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

@kaizhou-lab

Description

@kaizhou-lab

Problem

When officecli fails to spawn (ENOENT — not installed), the pptPreview.start provider re-throws the error. Since the IPC bridge's subscribe() function calls provider callbacks without a .catch(), the thrown error becomes an unhandled promise rejection.

Sentry Issue: ELECTRON-CT — 144 events

Root Cause

ipcBridge.pptPreview.start.provider at pptPreviewBridge.ts:305 re-throws the caught error. The bridge's internal subscribe() calls callback(data).then(...) without .catch(), so any rejected promise becomes unhandled.

Fix

Return { url: '', error: message } from the provider instead of throwing. Update the renderer (PptViewer) to check for the error field and throw locally where it's properly caught.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions