{"record":{"id":"9befd64ccd9334c5","repo":"Tencent/WeKnora","slug":"wiki-page-not-found","errorCode":null,"errorMessage":"wiki page not found","messagePattern":"wiki page not found","errorType":"error_code","errorClass":null,"httpStatus":404,"severity":"error","filePath":"internal/application/repository/wiki_page.go","lineNumber":18,"sourceCode":"package repository\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Tencent/WeKnora/internal/types\"\n\t\"github.com/Tencent/WeKnora/internal/types/interfaces\"\n\t\"gorm.io/gorm\"\n\t\"gorm.io/gorm/clause\"\n)\n\n// ErrWikiPageNotFound is returned when a wiki page is not found\nvar ErrWikiPageNotFound = errors.New(\"wiki page not found\")\n\n// ErrWikiPageConflict is returned when an optimistic lock conflict is detected\nvar ErrWikiPageConflict = errors.New(\"wiki page version conflict\")\n\n// wikiPageRepository implements the WikiPageRepository interface\ntype wikiPageRepository struct {\n\tdb *gorm.DB\n}\n\n// NewWikiPageRepository creates a new wiki page repository\nfunc NewWikiPageRepository(db *gorm.DB) interfaces.WikiPageRepository {\n\treturn &wikiPageRepository{db: db}\n}\n\nfunc (r *wikiPageRepository) wikiCategoryRankOrder() string {\n\tif r.db != nil && r.db.Dialector != nil && r.db.Dialector.Name() == \"sqlite\" {\n\t\treturn \"CASE WHEN COALESCE(json_array_length(category_path), 0) > 0 THEN 0 ELSE 1 END ASC\"\n\t}","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/repository/wiki_page.go#L1-L36","documentation":"Sentinel ErrWikiPageNotFound: a wiki page lookup (by slug or id) found no matching row — gorm.ErrRecordNotFound mapped. In graph/route resolution the caller treats it as 'skip this slug' rather than a fatal error.","triggerScenarios":"Thrown at internal/application/repository/wiki_page.go:18 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the slug/knowledge-base pair; the page may have been deleted or renamed","Skip the missing page in batch flows (as wiki_route_resolver does) or return 404 for direct requests"],"exampleFix":null,"handlingStrategy":"type-guard","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"}