{"record":{"id":"1f692120ee4dc076","repo":"kovidgoyal/kitty","slug":"could-not-get","errorCode":null,"errorMessage":"Could not get","messagePattern":"Could not get","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/process_images.go","lineNumber":246,"sourceCode":"\tb := img.Bounds()\n\tf := image_frame{width: b.Dx(), height: b.Dy(), number: len(imgd.frames) + 1, left: left, top: top}\n\tf.transmission_format = utils.IfElse(num_channels == 3, graphics.GRT_format_rgb, graphics.GRT_format_rgba)\n\tf.in_memory_bytes = pix\n\timgd.frames = append(imgd.frames, &f)\n\treturn &f\n}\n\nfunc process_arg(arg input_arg) {\n\tvar f opened_input\n\tif arg.is_http_url {\n\t\tresp, err := http.Get(arg.value)\n\t\tif err != nil {\n\t\t\treport_error(arg.value, \"Could not get\", err)\n\t\t\treturn\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\treport_error(arg.value, \"Could not get\", fmt.Errorf(\"bad status: %v\", resp.Status))\n\t\t\treturn\n\t\t}\n\t\tdest := bytes.Buffer{}\n\t\tdest.Grow(64 * 1024)\n\t\t_, err = io.Copy(&dest, resp.Body)\n\t\tif err != nil {\n\t\t\treport_error(arg.value, \"Could not download\", err)\n\t\t\treturn\n\t\t}\n\t\tf.bytes = dest.Bytes()\n\t\tf.file = bytes.NewReader(f.bytes)\n\t} else if arg.value == \"\" {\n\t\tstdin, err := io.ReadAll(os.Stdin)\n\t\tif err != nil {\n\t\t\treport_error(\"<stdin>\", \"Could not read from\", err)\n\t\t\treturn\n\t\t}\n\t\tf.bytes = stdin","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/process_images.go#L228-L264","documentation":"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').","triggerScenarios":"kitten icat https://example.com/missing.png returns 404/403, or the connection fails (DNS, TLS, offline).","commonSituations":"Hotlinking URLs that now 404 or redirect to HTML; corporate proxy blocking the request; expired CDN links; typo in the URL scheme.","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"],"exampleFix":"# before\nkitten icat https://example.com/img.png\n# after\ncurl -fLo /tmp/img.png https://example.com/img.png && kitten icat /tmp/img.png","handlingStrategy":"retry","validationCode":"resp, err := http.Head(url)\nif err != nil || resp.StatusCode != 200 { /* download beforehand or skip */ }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"bad status\") { /* retry with backoff or use cached copy */ }","preventionTips":["Verify URLs return 200 before batch icat runs","Download images locally with curl -f first","Set proxy env vars in restricted networks"],"tags":["kitty","icat","http","download"],"backgroundTag":"http-request-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}