glanceapp/glance · warning · errPartialContent

%w: could not fetch data for %d market(s)

Error message

%w: could not fetch data for %d market(s)

What it means

Partial-content warning from the markets widget: one or more symbols failed to fetch from Yahoo Finance, but at least one succeeded. The successfully fetched markets are returned together with errPartialContent, and each failure is logged with its symbol and error. Count of failed symbols is included.

Source

Thrown at internal/glance/widget-markets.go:199

			PriceHint:     result.Meta.PriceHint,
			Name: ternary(marketRequests[i].CustomName == "",
				result.Meta.ShortName,
				marketRequests[i].CustomName,
			),
			PercentChange: percentChange(
				result.Meta.RegularMarketPrice,
				previous,
			),
			SvgChartPoints: points,
		})
	}

	if len(markets) == 0 {
		return nil, errNoContent
	}

	if failed > 0 {
		return markets, fmt.Errorf("%w: could not fetch data for %d market(s)", errPartialContent, failed)
	}

	return markets, nil
}

var currencyToSymbol = map[string]string{
	"USD": "$",
	"EUR": "€",
	"JPY": "¥",
	"CAD": "C$",
	"AUD": "A$",
	"GBP": "£",
	"CHF": "Fr",
	"NZD": "N$",
	"INR": "₹",
	"BRL": "R$",
	"RUB": "₽",
	"TRY": "₺",

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Check the glance log lines 'Failed to fetch market data' to see which symbol(s) failed and why
  2. Correct or remove invalid/delisted ticker symbols
  3. Reduce the number of symbols or stagger updates if Yahoo is rate limiting
  4. If all symbols fail intermittently, verify connectivity to query1.finance.yahoo.com

Example fix

# before
  markets:
    - symbol: APL
# after
  markets:
    - symbol: AAPL
Defensive patterns

Strategy: fallback

Validate before calling

func validSymbols(symbols []string) []string {
    out := make([]string, 0, len(symbols))
    for _, s := range symbols {
        if regexp.MustCompile(`^[A-Za-z0-9.\-=^]{1,12}$`).MatchString(s) {
            out = append(out, s)
        }
    }
    return out
}

Try / catch

markets, err := fetchMarketsDataFromYahoo(reqs)
if errors.Is(err, errPartialContent) {
    slog.Warn("some market symbols failed", "error", err)
    return markets, nil // render the successful subset
}
if err != nil { return nil, err }

Prevention

When it happens

Trigger: Some GET chart/<symbol> requests fail while others succeed: invalid ticker symbol (Yahoo returns non-200), per-symbol rate limiting, or transient network errors for a subset of the parallel requests.

Common situations: Typo'd ticker (e.g. 'APL' instead of 'AAPL'); Yahoo rate limiting burst requests from one IP; symbols delisted or renamed; intermittent egress issues.

Related errors


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