UNPKG

@ma3-pro-plugins/ma3-pro-plugins-lib

Version:
25 lines (24 loc) 607 B
declare type LuaError = { name: string; stack: string; message: string; }; export declare function getErrorMessage(err: string | LuaError | ProError | any): string; export interface ProError { type: 'ProError'; message: string; tracebackPrinted: boolean; } /** * This replaces TSTL's try/catch (which uses pcall) * since it uses xpcall, that captures the FULL traceback. */ export declare function protectedCall<T>(params: { fn: () => T; onError: (err: ProError) => void; errorPrefix?: string; }): { success: boolean; returnValue: T | undefined; }; export {};