fix(desktop): show an error when opening a path in the default app fails (#62572)

This commit is contained in:
Dan Smolsky
2026-11-08 13:29:06 -05:00
committed by GitHub
Unverified
parent a687c047af
commit 088682cb1e
+7 -1
View File
@@ -124,7 +124,13 @@ function make(
return true
}),
openPath: Effect.fn("DesktopFiles.openPath")(function* (target: string, application?: string) {
if (!application) return yield* Effect.promise(() => shell.openPath(target))
if (!application) {
const error = yield* Effect.promise(() => shell.openPath(target))
if (error) return yield* Effect.fail(new Error(error))
return
}
if (process.platform === "win32" && /^powershell(\.exe)?$/i.test(path.basename(application))) {
const info = yield* fs.stat(target)