glanceapp/glance · warning · errPartialContent

%w: failed to fetch %d channels

Error message

%w: failed to fetch %d channels

What it means

Wraps errPartialContent after the twitch-channels widget fetched a list of channels and at least one (but not all) individual channel request failed. The widget still returns the channels that succeeded; the error signals degraded completeness to the partial-content rendering path.

Source

Thrown at internal/glance/widget-twitch-channels.go:234

	var failed int

	for i := range channels {
		if errs[i] != nil {
			failed++
			slog.Error("Failed to fetch Twitch channel", "channel", channelLogins[i], "error", errs[i])
			continue
		}

		result = append(result, channels[i])
	}

	if failed == len(channelLogins) {
		return result, errNoContent
	}

	if failed > 0 {
		return result, fmt.Errorf("%w: failed to fetch %d channels", errPartialContent, failed)
	}

	return result, nil
}

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Check the server logs for the matching 'Failed to fetch Twitch channel' lines to see which login failed and why
  2. Remove or fix misspelled/deleted channel logins in the twitch-channels widget config
  3. Increase cache-time or reduce the number of channels to avoid rate limiting
Defensive patterns

Strategy: fallback

Validate before calling

// Before configuring, sanity-check each login is a non-empty lowercase string
func validTwitchLogin(l string) bool {
	return l != "" && l == strings.ToLower(l) && !strings.ContainsAny(l, " /\u0000")
}

Type guard

func isPartialContent(err error) bool { return errors.Is(err, errPartialContent) }

Try / catch

channels, err := widget.getChannels()
if errors.Is(err, errPartialContent) {
    // render the successful channels; log the failed count
    slog.Warn("twitch partial fetch", "err", err)
} else if err != nil {
    return err
}

Prevention

When it happens

Trigger: One or more channel logins in the channels list fail (rate limit, deleted channel, GQL error) while others succeed, and failed < len(channelLogins). If every channel fails, errNoContent is returned instead.

Common situations: A deleted/renamed Twitch channel left in the config; intermittent 429s from gql.twitch.tv when tracking many channels with a short cache time.

Related errors


AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15). Data as JSON: /api/errors/d6ad2ceb607f8164. Report an issue: GitHub.