GlobalProtect-openconnect/gpgui/src/utils/invokeCommand.ts
2023-05-28 14:04:22 +08:00

10 lines
235 B
TypeScript

import { invoke } from "@tauri-apps/api";
export default async function invokeCommand<T>(command: string, args?: any) {
try {
return await invoke<T>(command, args);
} catch (err: any) {
throw new Error(err.message);
}
}