{"record":{"id":"dad8ef6a82198ee2","repo":"lima-vm/lima","slug":"v","errorCode":null,"errorMessage":"%v","messagePattern":"%v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/fileutils/download.go","lineNumber":78,"sourceCode":"\t\treturn \"\", fmt.Errorf(\"cache did not contain %#q: %w\", f.Location, err)\n\t}\n\treturn res.CachePath, nil\n}\n\n// Errors compose multiple into a single error.\n// Errors filters out ErrSkipped.\nfunc Errors(errs []error) error {\n\tvar finalErr error\n\tfor _, err := range errs {\n\t\tif errors.Is(err, ErrSkipped) {\n\t\t\tlogrus.Debug(err)\n\t\t} else {\n\t\t\tfinalErr = errors.Join(finalErr, err)\n\t\t}\n\t}\n\tif len(errs) > 0 && finalErr == nil {\n\t\t// errs only contains ErrSkipped\n\t\tfinalErr = fmt.Errorf(\"%v\", errs)\n\t}\n\treturn finalErr\n}\n","sourceCodeStart":60,"sourceCodeEnd":82,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/fileutils/download.go#L60-L82","documentation":"Errors() aggregates per-file errors from downloads; entries that are ErrSkipped are filtered, and if remaining fatal errors exist they are errors.Join-ed. When ALL errors were just ErrSkipped (nothing fatally failed), it returns fmt.Errorf(\"%v\", errs) — a non-wrapping message listing the skip reasons — because a joined sentinel could not be tested with errors.Is reliably.","triggerScenarios":"Calling Errors (via EnsureNerdctlArchiveCache, EnsureFs, Prepare) after downloading multiple files where some or all were skipped (e.g. arch-mismatched entries) and no hard failures occurred.","commonSituations":"Multi-file templates where some files target other architectures; every file entry skipped, leaving only skip notices in the aggregated error text.","solutions":["If this error is all skips, fix the file entries' arch fields so the needed file is actually downloaded","Use the printed list of skip messages to identify which files/locations were skipped","Filter ErrSkipped with errors.Is in your own aggregation if you compose errors similarly","Treat this as informational when other applicable files downloaded successfully"],"exampleFix":"// before\narch: \"x86_64\"  # entry skipped on arm64 host\n// after\narch: \"aarch64\"  # entry now downloaded","handlingStrategy":"type-guard","validationCode":"// ensure at least one file entry matches the current arch\nhasMatch := false\nfor _, f := range files {\n    if f.Arch == runtimeArch { hasMatch = true }\n}\nif !hasMatch { return errors.New(\"no file entries match this architecture\") }","typeGuard":"func isSkipped(err error) bool { return errors.Is(err, fileutils.ErrSkipped) }","tryCatchPattern":"err := fileutils.Errors(errs)\nif err != nil {\n    if isSkipped(err) || strings.Contains(err.Error(), \"skipped to download\") {\n        log.Info(\"only skip notices: \", err)\n        return nil\n    }\n    return err\n}","preventionTips":["Include correct-arch entries in multi-file templates","Filter ErrSkipped when aggregating your own errors","Log skip reasons but only fail on non-skip errors"],"tags":["download","error-aggregation","sentinel-error"],"backgroundTag":"download-skipped","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}