fix(shellBridge): handle shell.openPath errors to prevent unhandled rejections#1806
Merged
fix(shellBridge): handle shell.openPath errors to prevent unhandled rejections#1806
Conversation
…ejections shell.openPath can reject on Windows when no application is associated with the file type (error 0x483), producing an unhandled promise rejection (Sentry ELECTRON-C7, 10 events on v1.9.1). Wrap in try-catch and also check the returned error string for non-throwing failure cases. Fixes ELECTRON-C7
Contributor
Code Review:fix(shellBridge): handle shell.openPath errors to prevent unhandled rejections (#1806)变更概述本 PR 修复了 Windows 上 方案评估结论:✅ 方案合理
问题清单🔵 LOW —
|
| # | 严重级别 | 文件 | 问题 |
|---|---|---|---|
| 1 | 🔵 LOW | src/process/bridge/shellBridge.ts:18 |
(error as Error).message 断言不安全 |
结论
✅ 批准合并 — 无阻塞性问题,仅一个 LOW 级别日志健壮性建议,不影响功能正确性。
本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。
Contributor
|
✅ 已自动 review,无阻塞性问题,正在触发自动合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shell.openPathin try-catch to prevent unhandled promise rejections on Windows when no file association exists (error 0x483)Closes #1805
Fixes ELECTRON-C7
Sentry Details
Test plan
bun run test -- tests/unit/shellBridge.test.ts)bunx tsc --noEmit)bun run lint:fix)bun run format)