glanceapp/glance · error
%w: %v
Error message
%w: %v
What it means
Returned by the videos widget when the worker pool itself failed before any per-request results existed (workerPoolDo returned a non-nil err). The message wraps errNoContent, so the widget is treated as having no content to render rather than crashing the page.
Source
Thrown at internal/glance/widget-videos.go:163
var feedUrl string
if strings.HasPrefix(channelOrPlaylistIDs[i], videosWidgetPlaylistPrefix) {
feedUrl = "https://www.youtube.com/feeds/videos.xml?playlist_id=" +
strings.TrimPrefix(channelOrPlaylistIDs[i], videosWidgetPlaylistPrefix)
} else if !includeShorts && strings.HasPrefix(channelOrPlaylistIDs[i], "UC") {
playlistId := strings.Replace(channelOrPlaylistIDs[i], "UC", "UULF", 1)
feedUrl = "https://www.youtube.com/feeds/videos.xml?playlist_id=" + playlistId
} else {
feedUrl = "https://www.youtube.com/feeds/videos.xml?channel_id=" + channelOrPlaylistIDs[i]
}
request, _ := http.NewRequest("GET", feedUrl, nil)
requests = append(requests, request)
}
job := newJob(decodeXmlFromRequestTask[youtubeFeedResponseXml](defaultHTTPClient), requests).withWorkers(30)
responses, errs, err := workerPoolDo(job)
if err != nil {
return nil, fmt.Errorf("%w: %v", errNoContent, err)
}
videos := make(videoList, 0, len(channelOrPlaylistIDs)*15)
var failed int
for i := range responses {
if errs[i] != nil {
failed++
slog.Error("Failed to fetch youtube feed", "channel", channelOrPlaylistIDs[i], "error", errs[i])
continue
}
response := responses[i]
for j := range response.Videos {
v := &response.Videos[j]
var videoUrl string
View on GitHub (pinned to 91324e8de7)
Solutions
- Check surrounding logs for the underlying %v cause printed in the message
- Restart the Glance process to clear stuck worker state
- Reduce concurrent load (fewer channels or longer cache) if the host is resource-constrained
Defensive patterns
Strategy: fallback
Type guard
func isNoContent(err error) bool { return errors.Is(err, errNoContent) } Try / catch
videos, err := widget.getVideos()
if errors.Is(err, errNoContent) {
// render the widget's empty/no-content state rather than failing the page
renderNoContent()
return nil
} Prevention
- Keep channel counts and worker concurrency reasonable for the host's resources
- Treat errNoContent as an expected state, not an exception — always check it with errors.Is
When it happens
Trigger: workerPoolDo fails outright — e.g. all 30 workers unable to start/finish the batch — before individual youtube.com/feeds/videos.xml requests are even attempted; distinct from per-feed errs[] entries which are counted as 'failed'.
Common situations: System resource exhaustion (goroutine/thread limits in a tight container) or an internal pool misconfiguration; effectively a rare infrastructure failure, not a config error.
Related errors
- %w: missing videos from %d channels
- no categories could be retrieved
- failed to retrieve any content
- widget 'type' property is empty or not specified
- %s widget: %v
AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15).
Data as JSON: /api/errors/123f981cc3fe1fe5.
Report an issue: GitHub.