mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-19 07:36:17 +00:00
feat: implement persistent rolling log system with tauri-plugin-log
This commit is contained in:
+5
-1
@@ -1,4 +1,5 @@
|
||||
import { invoke as tauriInvoke } from '@tauri-apps/api/core';
|
||||
import { error as logError } from '@tauri-apps/plugin-log';
|
||||
import { listen as tauriListen, type Event, type EventCallback, type UnlistenFn } from '@tauri-apps/api/event';
|
||||
import type { DownloadCategory } from './bindings/DownloadCategory';
|
||||
import type { DownloadProgressEvent } from './bindings/DownloadProgressEvent';
|
||||
@@ -104,7 +105,10 @@ export function invokeCommand<K extends CommandName>(
|
||||
command: K,
|
||||
...args: CommandArgs<K> extends undefined ? [] : [args: CommandArgs<K>]
|
||||
): Promise<CommandResult<K>> {
|
||||
return tauriInvoke<CommandResult<K>>(command, args[0]);
|
||||
return tauriInvoke<CommandResult<K>>(command, args[0]).catch(err => {
|
||||
logError(`Invoke command ${command} failed: ${err}`);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
type EventMap = {
|
||||
|
||||
Reference in New Issue
Block a user