{"record":{"id":"c145218ddc52b6fa","repo":"Tencent/WeKnora","slug":"error-c14521","errorCode":null,"errorMessage":"标准问不能为空","messagePattern":"标准问不能为空","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/knowledge_faq_import.go","lineNumber":966,"sourceCode":"\t}\n\tfor _, s := range b {\n\t\ts = strings.TrimSpace(s)\n\t\tif s != \"\" && !seen[s] {\n\t\t\tseen[s] = true\n\t\t\tresult = append(result, s)\n\t\t}\n\t}\n\treturn result\n}\n\n// validateFAQEntryPayloadBasic 验证 FAQ 条目的基本格式\nfunc validateFAQEntryPayloadBasic(entry *types.FAQEntryPayload) error {\n\tif entry == nil {\n\t\treturn fmt.Errorf(\"条目不能为空\")\n\t}\n\tstandardQ := strings.TrimSpace(entry.StandardQuestion)\n\tif standardQ == \"\" {\n\t\treturn fmt.Errorf(\"标准问不能为空\")\n\t}\n\tif len(entry.Answers) == 0 {\n\t\treturn fmt.Errorf(\"答案不能为空\")\n\t}\n\thasValidAnswer := false\n\tfor _, a := range entry.Answers {\n\t\tif strings.TrimSpace(a) != \"\" {\n\t\t\thasValidAnswer = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !hasValidAnswer {\n\t\treturn fmt.Errorf(\"答案不能全为空\")\n\t}\n\treturn nil\n}\n\ntype faqMergeOperation struct {","sourceCodeStart":948,"sourceCodeEnd":984,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_faq_import.go#L948-L984","documentation":"Basic FAQ import validation (validateFAQEntryPayloadBasic): the entry's StandardQuestion, after trimming whitespace, is empty. The standard question is the mandatory canonical form of a FAQ entry, so an import row without it is rejected during append/replace-mode validation.","triggerScenarios":"Thrown at internal/application/service/knowledge_faq_import.go:966 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-blank standard question for the failing entry","Trim whitespace when constructing entries client-side","Use dry-run mode to list all rows missing a standard question"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}