Tencent/WeKnora · error
list wiki page revisions: %w
Error message
list wiki page revisions: %w
What it means
Repository error in wikiPageService.ListRevisions: querying the stored historical snapshots for the page failed at the storage layer. The %w wraps the underlying database error so callers (revision-history handlers) can log/translate the real cause; it fires on DB failure, not on a missing page, which is checked separately.
Source
Thrown at internal/application/service/wiki_page.go:293
}
// ErrWikiRevertToCurrentVersion is returned when a revert targets the version
// the page is already on — a client-side mistake (usually a stale history
// list), not a server fault, so handlers map it to 400.
var ErrWikiRevertToCurrentVersion = errors.New("cannot revert to the current version")
// ListRevisions returns the stored historical snapshots for a page (newest
// first, content omitted) plus the page's current version.
func (s *wikiPageService) ListRevisions(
ctx context.Context, kbID string, slug string, limit int, offset int,
) (*types.WikiPageRevisionListResponse, error) {
page, err := s.repo.GetBySlug(ctx, kbID, slug)
if err != nil {
return nil, err
}
revs, total, err := s.repo.ListRevisions(ctx, kbID, page.ID, limit, offset)
if err != nil {
return nil, fmt.Errorf("list wiki page revisions: %w", err)
}
return &types.WikiPageRevisionListResponse{
Revisions: revs,
Total: total,
CurrentVersion: page.Version,
}, nil
}
// GetRevision returns one historical snapshot with content.
func (s *wikiPageService) GetRevision(
ctx context.Context, kbID string, slug string, version int,
) (*types.WikiPageRevision, error) {
page, err := s.repo.GetBySlug(ctx, kbID, slug)
if err != nil {
return nil, err
}
return s.repo.GetRevision(ctx, kbID, page.ID, version)
}View on GitHub (pinned to 988cbb0330)
Solutions
- Check DB connectivity and the revision repo
- Inspect the wrapped repository error
- Retry listing revisions
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at internal/application/service/wiki_page.go:293 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/f8a84029090588dc.
Report an issue: GitHub.