Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Heuristic:1broseidon Ketch Deprecated ErrNotCached

From Leeroopedia
Knowledge Sources
Domains Tagging, Deprecation
Last Updated 2026-10-27 00:00 GMT

Overview

The `cache.ErrNotCached` error is retained only for source compatibility — it is never returned, and callers should treat tagging an uncached URL as a success, not an error.

The Insight (Rule of Thumb)

  • Action: Do not check for `cache.ErrNotCached` in new code. A URL can be tagged whether or not its body is cached; `TagURL` reports `cached bool` instead of returning this error.
  • Value: The variable is kept so callers compiled against the old behaviour still build, but it will be removed in a later release.
  • Trade-off: None for callers — the new behaviour (succeed, report `cached: false`) is strictly more useful than the old (return an error).
  • Compatibility: Existing code that switches on `errors.Is(err, cache.ErrNotCached)` will never enter that branch; migrate to the `cached bool` return value.

Reasoning

The tag index is a durable record, not a view over the page cache. When the design shifted so that `tag add` and `--tag` succeed for an uncached URL (storing an entry with no title/description until the page is fetched), `ErrNotCached` became dead code: no code path returns it. It is kept exported so a caller compiled against the prior API does not break at link time, but the deprecation marks it for removal once external callers have migrated to the `cached bool` contract.

The source comment at `cache/tags.go:26-31` makes the intent explicit:

// ErrNotCached is no longer returned: a URL can be tagged whether or not its
// body is cached. Kept so callers compiled against the old behaviour still
// build; it will be removed in a later release.
//
// Deprecated: tagging an uncached URL succeeds and yields an entry with no
// title or description until the page is fetched.
var ErrNotCached = errors.New("page is not in the cache")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment