Skip to content

fix(shellBridge): shell.openPath unhandled rejection on Windows (ELECTRON-C7) #1805

@kaizhou-lab

Description

@kaizhou-lab

Problem

shell.openPath in shellBridge.ts can reject on Windows when no application is associated with the target file type (Windows error 0x483). This produces an unhandled promise rejection reported as Sentry ELECTRON-C7 (10 events on v1.9.1, last seen 6 hours ago).

Root Cause

The openFile IPC bridge provider calls await shell.openPath(path) without error handling. On Windows, when there's no file association, shell.openPath rejects instead of resolving with an error string.

Fix

Wrap shell.openPath in try-catch and also check the returned error string for non-throwing failure cases.

Sentry Reference

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