{"record":{"id":"2dc73243404bfdd4","repo":"kovidgoyal/kitty","slug":"s-w","errorCode":null,"errorMessage":"%s: %w","messagePattern":"%s: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/process_images.go","lineNumber":152,"sourceCode":"\t\tswitch fit_mode {\n\t\tcase fit_none:\n\t\t\timgd.available_width, imgd.available_height = inf, inf\n\t\tcase fit_both:\n\t\t\timgd.available_width = int(screen_size.Xpixel)\n\t\t\timgd.available_height = int(screen_size.Ypixel)\n\t\tcase fit_width:\n\t\t\timgd.available_width = int(screen_size.Xpixel)\n\t\t\timgd.available_height = inf\n\t\tcase fit_height:\n\t\t\timgd.available_width = inf\n\t\t\timgd.available_height = int(screen_size.Ypixel)\n\t\t}\n\t}\n\timgd.needs_scaling = imgd.canvas_width > imgd.available_width || imgd.canvas_height > imgd.available_height || opts.ScaleUp\n}\n\nfunc report_error(source_name, msg string, err error) {\n\timgd := image_data{source_name: source_name, err: fmt.Errorf(\"%s: %w\", msg, err)}\n\tsend_output(&imgd)\n}\n\nfunc make_output_from_input(imgd *image_data, f *opened_input) {\n\tframe := image_frame{}\n\timgd.frames = append(imgd.frames, &frame)\n\tframe.width = imgd.canvas_width\n\tframe.height = imgd.canvas_height\n\tif imgd.format_uppercase != \"PNG\" {\n\t\tpanic(fmt.Sprintf(\"Unknown transmission format: %s\", imgd.format_uppercase))\n\t}\n\tframe.transmission_format = graphics.GRT_format_png\n\tif f.bytes != nil {\n\t\tframe.in_memory_bytes = f.bytes\n\t} else if f.path != \"\" {\n\t\tframe.filename = f.path\n\t} else {\n\t\tvar err error","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/process_images.go#L134-L170","documentation":"report_error is icat's generic per-image error wrapper: it formats '<msg>: <err>' into the image's result and forwards it to the output channel. Seeing this message means an image failed during processing and this is the prefix of the underlying cause.","triggerScenarios":"Any of the per-image failure paths in process_arg (HTTP fetch failure, decode failure, file read failure) funnels through report_error(arg.value, msg, err).","commonSituations":"Batch-displaying images where one URL/file is bad; the real cause is in the wrapped %w — read the suffix of the message.","solutions":["Read the wrapped error after the colon to identify the real cause","Validate/preview inputs (HTTP reachability, file readability, image decodability) before batch runs","Retry with a single image to isolate the failing one"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if imgd.err != nil && strings.HasPrefix(imgd.err.Error(), \"Could not get\") { /* handle fetch failure, skip image */ }","preventionTips":["Look at the wrapped cause after the prefix","Batch-validate inputs before display"],"tags":["kitty","icat","image-processing","error-wrapping"],"backgroundTag":"image-processing-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}