better logging for plugins + fix caps lock not working keylogger
This commit is contained in:
@@ -111,6 +111,8 @@ self.onmessage = async (e: MessageEvent<WorkerInbound>) => {
|
||||
send({ type: "rpc_reply", id: msg.id, ok: true, result: result ?? null });
|
||||
} catch (err) {
|
||||
const error = err instanceof Error ? err.message : String(err);
|
||||
const stack = err instanceof Error ? err.stack || "" : "";
|
||||
console.error(`[plugin-worker] RPC ${msg.method} error: ${error}`, stack);
|
||||
send({ type: "rpc_reply", id: msg.id, ok: false, error });
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -953,6 +953,7 @@ export async function handlePluginRoutes(
|
||||
metrics.recordCommand("plugin_rpc");
|
||||
return Response.json({ ok: true, result });
|
||||
} catch (err) {
|
||||
console.error(`[plugin:${pluginId}] RPC ${method} error:`, (err as Error).message, (err as Error).stack || "");
|
||||
return Response.json({ ok: false, error: (err as Error).message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user