{"record":{"id":"3c589021d173bd76","repo":"siyuan-note/siyuan","slug":"data-error-message","errorCode":null,"errorMessage":"data.error.message","messagePattern":"data\\.error\\.message","errorType":"exception","errorClass":"JsonRpcError","httpStatus":null,"severity":"error","filePath":"app/src/plugin/kernel.ts","lineNumber":205,"sourceCode":"                return data;\n            }\n            await new Promise(resolve => window.setTimeout(resolve, KERNEL_PLUGIN_START_RETRY_INTERVAL));\n        }\n    }\n\n    async #initState() {\n        const response = await fetchSyncPost(\"/api/plugin/getLoadedPlugin\", { name: this.#name });\n        if (this.state.code === -1 && response.data?.stateCode != null) {\n            this.state.code = response.data.stateCode;\n        }\n    }\n\n    async #rpcCall(method: TJsonRpcMethod, ...params: TJsonRpcMethodParams): Promise<any> {\n        const id = this.#generateId();\n\n        const data = await this.#fetchRpc(JSON.stringify({ jsonrpc: \"2.0\", id, method, params }));\n        if (data.error) {\n            throw new JsonRpcError(data.error);\n        }\n        return data.result;\n    }\n\n    #rpcNotify(method: TJsonRpcMethod, ...params: TJsonRpcMethodParams): void {\n        this.#fetchRpc(JSON.stringify({ jsonrpc: \"2.0\", method, params })).catch((error) => {\n            console.error(`Failed to send JSON-RPC notification for method ${method}:`, error);\n        });\n    }\n\n    async #rpcBatchCall(...calls: IKernelPluginRpcCall[]): Promise<IKernelPluginRpcError | (IKernelPluginRpcResultResponse | IKernelPluginRpcErrorResponse)[]> {\n        const requests = calls.map(call => {\n            const request: IKernelPluginRpcRequest = { jsonrpc: \"2.0\", method: call.method };\n            if (call.params != null) {\n                request.params = call.params;\n            }\n            if (!call.notification) {\n                request.id = call.id ?? this.#generateId();","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/app/src/plugin/kernel.ts#L187-L223","documentation":"In KernelPluginClient #rpcCall, the kernel answered the JSON-RPC request but the response object carried an error; the thrown Error uses data.error.message from the remote side. The invoked plugin RPC method failed on the kernel (method not found, handler error, or argument error).","triggerScenarios":"Thrown at app/src/plugin/kernel.ts:205 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read data.error.message to identify the failing RPC method","Check that the RPC method was bound with matching name and signature","Handle the rejection in the calling plugin code instead of leaving it uncaught"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}