fix: throw error when extension permission failed. It didn't throw error

This commit is contained in:
Huakun Shen 2025-01-21 10:34:52 -05:00
parent 646801ac99
commit f03cb6cbad

View File

@ -84,8 +84,10 @@ export function constructShellApi(
program: string,
args: string[],
options: InternalSpawnOptions
): Promise<ChildProcess<IOPayload>> {
await verifyShellCmdPermission(ShellPermissionMap.execute, objectPermissions, program, args)
): Promise<ChildProcess<IOPayload>> {
await verifyShellCmdPermission(ShellPermissionMap.execute, objectPermissions, program, args).catch(err => {
throw new Error(err)
})
return invoke<ChildProcess<IOPayload>>("plugin:shellx|execute", {
program: program,
args: args,