{"record":{"id":"29e375723284e1d7","repo":"Tencent/WeKnora","slug":"failed-to-list-knowledge-w","errorCode":null,"errorMessage":"failed to list knowledge: %w","messagePattern":"failed to list knowledge: %w","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"internal/application/service/knowledge_faq_import.go","lineNumber":2818,"sourceCode":"\t}\n\n\treturn &progress, nil\n}\n\n// UpdateLastFAQImportResultDisplayStatus updates the display status of FAQ import result\nfunc (s *knowledgeService) UpdateLastFAQImportResultDisplayStatus(ctx context.Context, kbID string, displayStatus string) error {\n\t// 验证displayStatus参数\n\tif displayStatus != \"open\" && displayStatus != \"close\" {\n\t\treturn werrors.NewBadRequestError(\"invalid display status, must be 'open' or 'close'\")\n\t}\n\n\t// 获取当前空间ID\n\ttenantID := ctx.Value(types.TenantIDContextKey).(uint64)\n\n\t// 查找FAQ类型的knowledge\n\tknowledgeList, err := s.repo.ListKnowledgeByKnowledgeBaseID(ctx, tenantID, kbID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list knowledge: %w\", err)\n\t}\n\n\t// 查找FAQ类型的knowledge\n\tvar faqKnowledge *types.Knowledge\n\tfor _, k := range knowledgeList {\n\t\tif k.Type == types.KnowledgeTypeFAQ {\n\t\t\tfaqKnowledge = k\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif faqKnowledge == nil {\n\t\treturn werrors.NewNotFoundError(\"FAQ knowledge not found in this knowledge base\")\n\t}\n\n\t// 解析当前的导入结果\n\tresult, err := faqKnowledge.GetLastFAQImportResult()\n\tif err != nil {","sourceCodeStart":2800,"sourceCodeEnd":2836,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/knowledge_faq_import.go#L2800-L2836","documentation":"Thrown by UpdateLastFAQImportResultDisplayStatus when repo.ListKnowledgeByKnowledgeBaseID fails to list knowledge for the KB. A database read failure while locating the FAQ knowledge whose import-result display status should change.","triggerScenarios":"Thrown at internal/application/service/knowledge_faq_import.go:2818 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check database connectivity and retry the request","Verify the knowledge base ID and tenant context are correct","Inspect the wrapped repository error for timeouts or filters"],"exampleFix":null,"handlingStrategy":"retry","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"}