{"record":{"id":"b518170b82d94d1a","repo":"siyuan-note/siyuan","slug":"result-msg","errorCode":null,"errorMessage":"result.Msg","messagePattern":"result\\.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/9f775e8a12daef8255556097396f9b2739078892/kernel/model/export.go#L497-L533","documentation":"After a successful HTTP 200 from the Liandi article API, the kernel checks the JSON envelope's business Code. If result.Code != 0, the request failed at the application level and the kernel returns errors.New(result.Msg) — i.e. the error message is Liandi's own API message string, passed through verbatim to the caller.","triggerScenarios":"Calling Export2Liandi when Liandi returns 200 with a non-zero code in the JSON body — e.g. quota exceeded, invalid article content, permission denied on the target account, or duplicate/conflicting article state.","commonSituations":"Account restrictions or expired Liandi membership; content policy rejection; API contract changes on the Liandi side producing new error messages.","solutions":["Read the returned msg text — it comes from Liandi and names the concrete application-level problem.","Re-authenticate with Liandi if the message indicates token/session issues.","Reduce or sanitize the document content if the message indicates size or content rejection.","Retry later if the message suggests a transient server-side condition."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n    // err text is Liandi's result.Msg; show it to the user verbatim\n    showUserError(err.Error())\n    return err\n}","preventionTips":["Treat the returned message as authoritative from Liandi and display it","Check account quota/permissions on Liandi before publishing","Log result.Code alongside msg for diagnosis"],"tags":["liandi","api-error","remote"],"backgroundTag":"api-error-response","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}