wtfutil/wtf · warning

no links

Error message

no links

What it means

GetLinks successfully parses a Reddit listing JSON but finds zero children in data.children, meaning the subreddit listing is empty. It treats an empty feed as an error because the widget has nothing to render.

Source

Thrown at modules/subreddit/api.go:50

	resp, err := client.Do(request)

	if err != nil {
		return nil, err
	}
	defer func() { _ = resp.Body.Close() }()

	if resp.StatusCode > 299 {
		return nil, fmt.Errorf("%s", resp.Status)
	}
	var m RedditDocument
	err = utils.ParseJSON(&m, resp.Body)

	if err != nil {
		return nil, err
	}

	if len(m.Data.Children) == 0 {
		return nil, fmt.Errorf("no links")
	}

	var links []Link
	for _, l := range m.Data.Children {
		links = append(links, l.Data)
	}
	return links, nil
}

View on GitHub (pinned to bb838c1ccb)

Solutions

  1. Verify the subreddit actually has posts by visiting reddit.com/r/<name>
  2. Pick a more active subreddit in the widget config
  3. Log in / use authenticated API access if Reddit hides listings from anonymous requests
  4. Treat this as expected in callers for low-traffic subreddits
Defensive patterns

Strategy: fallback

Validate before calling

// fetch the listing and check before use
if doc.Data != nil && len(doc.Data.Children) == 0 { return nil, errEmptyFeed }

Try / catch

links, err := GetLinks(subreddit)
if err != nil {
    if err.Error() == "no links" { renderEmptyState(); return }
    return err
}

Prevention

When it happens

Trigger: HTTP 200 with valid listing JSON whose data.children array is empty — e.g. a brand-new subreddit with no posts, a heavily filtered/quarantined subreddit, or a subreddit returning an empty listing to unauthenticated requests.

Common situations: Freshly created subreddits with no submissions; subreddits where all posts were removed; spammed/hidden listings; rare cases of Reddit returning empty payloads to anonymous users.

Related errors


AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03). Data as JSON: /api/errors/017106722883151b. Report an issue: GitHub.