{"record":{"id":"9d6b37a89aff0ea5","repo":"goharbor/harbor","slug":"empty-json-data","errorCode":null,"errorMessage":"empty JSON data","messagePattern":"empty JSON data","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/p2p/preheat/provider/preheat_image.go","lineNumber":60,"sourceCode":"\tHeaders map[string]any `json:\"headers\"`\n\n\t// The image name\n\tImageName string `json:\"image,omitempty\"`\n\n\t// The tag\n\tTag string `json:\"tag,omitempty\"`\n\n\t// Digest of the preheating image\n\tDigest string `json:\"digest\"`\n\n\t// ExtraAttrs contains extra attributes for the preheating image.\n\tExtraAttrs map[string]any `json:\"extra_attrs,omitempty\"`\n}\n\n// FromJSON build preheating image from the given data.\nfunc (img *PreheatImage) FromJSON(data string) error {\n\tif len(data) == 0 {\n\t\treturn errors.New(\"empty JSON data\")\n\t}\n\n\tif err := json.Unmarshal([]byte(data), img); err != nil {\n\t\treturn fmt.Errorf(\"construct preheating image error: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// ToJSON encodes the preheating image to JSON data.\nfunc (img *PreheatImage) ToJSON() (string, error) {\n\tdata, err := json.Marshal(img)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"encode preheating image error: %w\", err)\n\t}\n\n\treturn string(data), nil\n}","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/p2p/preheat/provider/preheat_image.go#L42-L78","documentation":"Error \"empty JSON data\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/p2p/preheat/provider/preheat_image.go:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}