Version: dev

cache_miss

Stable error · Errors

Tier: stable · Kind: error · Topic: Errors

PythonJuliaRust
CacheMissCacheMissnot exported

Python

class CacheMiss(EarthSciIOError)
CacheMiss(resolved_url: str, key: str)

Raised in offline mode when the blob for a resolved URL is absent.

Per spec/offline-mode.md §2 this is never a silent empty result and never a fallback fetch — offline is cache-only. The error carries the resolved_url and the derived key (sha256(resolved_url)) so the caller can point at the exact blob the corpus/cache is missing. Carrying both is a cross-language requirement (the Julia/Rust CacheMiss do the same).

Source

Example (offline)

offline = Cache(root=cache_root, offline=True)
assert offline.fetch(URL).path == entry.path  # served from disk only

try:
    offline.fetch((FIXTURES / "not-cached.csv").as_uri())
    raise AssertionError("an offline miss must raise")
except CacheMiss:
    pass  # offline mode never touches the network

From docs/api/examples/python/fetch.py

Julia

struct CacheMiss <: Exception
CacheMiss(url::String, key::String)
CacheMiss(url, key)

Raised in offline mode when the blob for a resolved URL is absent. Carries both the url and its key so a failure names exactly which blob is missing.

Source

Example (offline)

offline = Cache(; root = CACHE_ROOT, offline = true)
@assert is_offline(offline)
@assert fetch_blob(offline, URL).path == entry.path  # served from disk only

missed = try
    fetch_blob(offline, "file://" * abspath(joinpath(FIXTURES, "not-cached.csv")))
    false
catch err
    err isa CacheMiss  # offline mode never touches the network
end
@assert missed

From docs/api/examples/julia/fetch.jl

Rust

Rust does not export this error.