{"record":{"id":"3da7118f644c8f78","repo":"siyuan-note/siyuan","slug":"result-msg-send-article-to-liandi-failed-code-d","errorCode":null,"errorMessage":"result.Msg (send article to liandi failed [code=%d, msg=%s])","messagePattern":"result\\.Msg \\(send article to liandi failed \\[code=(.+?), msg=(.+?)\\]\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/export.go","lineNumber":515,"sourceCode":"\t\t\tresp, sendErr = request.Put(apiURL)\n\t\t} else {\n\t\t\tresp, sendErr = request.Post(apiURL)\n\t\t}\n\t\tif nil != sendErr {\n\t\t\tlogging.LogErrorf(\"send article to liandi failed: %s\", sendErr)\n\t\t\treturn sendErr\n\t\t}\n\t\tif 200 != resp.StatusCode {\n\t\t\tmsg := fmt.Sprintf(\"send article to liandi failed [sc=%d]\", resp.StatusCode)\n\t\t\tlogging.LogError(msg)\n\t\t\treturn errors.New(msg)\n\t\t}\n\n\t\tif 0 != result.Code {\n\t\t\tmsg := fmt.Sprintf(\"send article to liandi failed [code=%d, msg=%s]\", result.Code, result.Msg)\n\t\t\tlogging.LogError(msg)\n\t\t\tutil.PushClearMsg(msgId)\n\t\t\treturn errors.New(result.Msg)\n\t\t}\n\n\t\tif !foundArticle {\n\t\t\tarticleId = result.Data.(string)\n\t\t\ttree, _ = LoadTreeByBlockID(id) // 这里必须重新加载，因为前面导出时已经修改了树结构\n\t\t\ttree.Root.SetIALAttr(liandiArticleIdAttrName, articleId)\n\t\t\tif err = writeTreeUpsertQueue(tree); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tutil.PushMsg(fmt.Sprintf(Conf.Language(181), util.GetCloudAccountServer()+\"/article/\"+articleId), 7000)\n\t\treturn nil\n\t})\n\treturn\n}\n\nfunc ExportSystemLog() (zipPath string) {","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/export.go#L497-L533","documentation":"After the Liandi send request returns HTTP 200 but the JSON body carries result.Code != 0, the kernel logs the wrapped message and returns errors.New(result.Msg) — the Liandi server's own business-error message is surfaced to the user. The literal 'send article to liandi failed [code=%d, msg=%s]' appears in the log, while the returned error text is result.Msg itself.","triggerScenarios":"Liandi API returns {code: !=0, msg: ...} for a send/lookup request — e.g. invalid API token, quota exceeded, or article content rejected server-side.","commonSituations":"Expired Liandi access token, hitting the daily post limit, banned/restricted Liandi account, content flagged by server validation.","solutions":["Read the msg text in the error — it comes from the Liandi server and usually names the cause (auth, quota)","Re-authenticate the cloud/Liandi account in SiYuan settings","Wait if it is a quota/rate issue, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await export2Liandi(blockId);\n} catch (e) {\n  // e.msg is the Liandi server's business message; surface it verbatim to the user\n  showHint(e.msg || e.message);\n  if (/token|auth/i.test(e.msg)) promptRelogin();\n}","preventionTips":["Keep cloud/Liandi account authenticated before export","Respect Liandi posting quotas to avoid code!=0 business errors","Always show result.Msg to the user — it names the exact server-side cause"],"tags":["api","liandi","remote-error"],"backgroundTag":"api-error-response","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}