glanceapp/glance · warning · errPartialContent
%w: could not get %d watches
Error message
%w: could not get %d watches
What it means
Returned from the changedetection widget fetch when at least one (but not all) watch details could not be retrieved: the code counted failures in `failed` and wraps the sentinel errPartialContent with ": could not get %d watches". The successfully fetched watches are still returned alongside the error, so callers can render partial content.
Source
Thrown at internal/glance/widget-changedetection.go:193
if len(watchJson.PreviousHash) < hashLength {
hashLength = len(watchJson.PreviousHash)
}
watch.PreviousHash = watchJson.PreviousHash[0:hashLength]
}
watches = append(watches, watch)
}
if len(watches) == 0 {
return nil, errNoContent
}
watches.sortByNewest()
if failed > 0 {
return watches, fmt.Errorf("%w: could not get %d watches", errPartialContent, failed)
}
return watches, nil
}
View on GitHub (pinned to 91324e8de7)
Solutions
- Treat it as partial data: the returned slice is valid; render it and surface a warning instead of discarding everything.
- Identify the failing watch by fetching each UUID individually and remove/fix the deleted or broken one.
- If rate limiting, reduce the number of watches or increase the widget cache duration (cache: 15m).
- If persistent, check the changedetection.io instance logs for the failing per-watch request.
Example fix
// before
watches, err := fetchWatchesFromChangeDetection(url, ids, token)
if err != nil {
return err // drops all successfully fetched watches
}
// after
watches, err := fetchWatchesFromChangeDetection(url, ids, token)
if errors.Is(err, errPartialContent) {
slog.Warn("partial changedetection content", "error", err)
// proceed with `watches` (non-nil)
} else if err != nil {
return err
} Defensive patterns
Strategy: fallback
Try / catch
watches, err := fetchWatchesFromChangeDetection(url, ids, token)
switch {
case errors.Is(err, errPartialContent):
// watches is non-nil: render what we got, note the degradation
case errors.Is(err, errNoContent):
// no watches at all: show empty state
_ = watches
case err != nil:
return err
} Prevention
- Prune deleted watch UUIDs from the widget's watch list periodically.
- Keep watch counts modest or raise cache duration to avoid per-watch request bursts.
- Distinguish errPartialContent from fatal errors in dashboards so partial data is not discarded.
When it happens
Trigger: fetchWatchesFromChangeDetection loops over requested watch IDs; one per-watch GET times out, returns a non-2xx status, or fails JSON decode while others succeed, incrementing failed and triggering this after sorting.
Common situations: A single watch in the list was deleted server-side (404), transient network hiccup to one request, rate limiting when many watches are configured, instance restarting mid-refresh.
Related errors
- could not fetch list of watch UUIDs: %v
- %w: failed to fetch %d channels
- %w: missing videos from %d channels
- no categories could be retrieved
- failed to retrieve any content
AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15).
Data as JSON: /api/errors/1307a20617015e66.
Report an issue: GitHub.