kovidgoyal/kitty · error
Could not get
Error message
Could not get
What it means
While fetching an image over HTTP(S), either http.Get failed or the response status was not 200. report_error prefixes 'Could not get' to the underlying error (e.g. DNS failure, timeout, or 'bad status: 404 Not Found').
Source
Thrown at kittens/icat/process_images.go:246
b := img.Bounds()
f := image_frame{width: b.Dx(), height: b.Dy(), number: len(imgd.frames) + 1, left: left, top: top}
f.transmission_format = utils.IfElse(num_channels == 3, graphics.GRT_format_rgb, graphics.GRT_format_rgba)
f.in_memory_bytes = pix
imgd.frames = append(imgd.frames, &f)
return &f
}
func process_arg(arg input_arg) {
var f opened_input
if arg.is_http_url {
resp, err := http.Get(arg.value)
if err != nil {
report_error(arg.value, "Could not get", err)
return
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
report_error(arg.value, "Could not get", fmt.Errorf("bad status: %v", resp.Status))
return
}
dest := bytes.Buffer{}
dest.Grow(64 * 1024)
_, err = io.Copy(&dest, resp.Body)
if err != nil {
report_error(arg.value, "Could not download", err)
return
}
f.bytes = dest.Bytes()
f.file = bytes.NewReader(f.bytes)
} else if arg.value == "" {
stdin, err := io.ReadAll(os.Stdin)
if err != nil {
report_error("<stdin>", "Could not read from", err)
return
}
f.bytes = stdinView on GitHub (pinned to 6d5d0c4406)
Solutions
- curl -I the URL to check status and reachability
- Fix or replace the dead URL / download the image locally first
- Add proxy env vars (HTTPS_PROXY) if behind a corporate network
- Handle non-200 by downloading with retries before passing a local file to icat
Example fix
# before kitten icat https://example.com/img.png # after curl -fLo /tmp/img.png https://example.com/img.png && kitten icat /tmp/img.png
Defensive patterns
Strategy: retry
Validate before calling
resp, err := http.Head(url)
if err != nil || resp.StatusCode != 200 { /* download beforehand or skip */ } Try / catch
if err != nil && strings.Contains(err.Error(), "bad status") { /* retry with backoff or use cached copy */ } Prevention
- Verify URLs return 200 before batch icat runs
- Download images locally with curl -f first
- Set proxy env vars in restricted networks
When it happens
Trigger: kitten icat https://example.com/missing.png returns 404/403, or the connection fails (DNS, TLS, offline).
Common situations: Hotlinking URLs that now 404 or redirect to HTML; corporate proxy blocking the request; expired CDN links; typo in the URL scheme.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- Failed to download %s with error: %w
- Timed out waiting for a response from the terminal: %w
- Invalid value for --background: %w
- Invalid value for --z-index with error: %w
- unknown fit specification: %#v
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/1f692120ee4dc076.
Report an issue: GitHub.