{"record":{"id":"5cdcf9cff51079f3","repo":"Tencent/WeKnora","slug":"load-index-page-w","errorCode":null,"errorMessage":"load index page: %w","messagePattern":"load index page: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/wiki_page.go","lineNumber":475,"sourceCode":"//\n// `pageTypes` narrows which groups to include; empty = all content types.\n// `limit` is the per-group window size (defaults to 50, capped at 200).\n// `cursor` is an opaque offset string; currently we use the stringified\n// offset so clients can resume where they left off. Because different\n// page_types paginate independently, `cursor` applies uniformly to every\n// group — if the caller wants per-group cursors it should request one\n// type at a time via `pageTypes`. That simplifies the wire format and\n// matches the frontend's tabbed UX.\nfunc (s *wikiPageService) GetIndexView(\n\tctx context.Context,\n\tkbID string,\n\tpageTypes []string,\n\tlimit int,\n\tcursor string,\n) (*types.WikiIndexResponse, error) {\n\tindexPage, err := s.GetIndex(ctx, kbID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"load index page: %w\", err)\n\t}\n\n\tif limit <= 0 {\n\t\tlimit = 50\n\t}\n\tif limit > 200 {\n\t\tlimit = 200\n\t}\n\toffset := 0\n\tif cursor != \"\" {\n\t\tv, parseErr := strconv.Atoi(cursor)\n\t\tif parseErr != nil || v < 0 {\n\t\t\treturn nil, fmt.Errorf(\"invalid cursor %q\", cursor)\n\t\t}\n\t\toffset = v\n\t}\n\n\t// Default to every known content type when the caller passes no","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/wiki_page.go#L457-L493","documentation":"Repository error in wikiPageService.GetIndexView: loading the wiki's index/landing page — the anchor the index view is built around — failed. The %w preserves the underlying store error; it fires when the index page lookup itself errors, before group pagination and cursor handling run.","triggerScenarios":"Thrown at internal/application/service/wiki_page.go:475 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the index page exists for the KB","Check repo/DB availability via the wrapped error","Retry the index view request"],"exampleFix":null,"handlingStrategy":"try-catch","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"}