{"record":{"id":"d68e8bf717060e2b","repo":"goharbor/harbor","slug":"http-status-code-d-body-s-d68e8b","errorCode":null,"errorMessage":"http status code: %d, body: %s","messagePattern":"http status code: (.+?), body: (.+?)","errorType":"console","errorClass":"errors.Error","httpStatus":null,"severity":"error","filePath":"src/registryctl/client/client.go","lineNumber":136,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode < 200 || resp.StatusCode > 299 {\n\t\tdefer resp.Body.Close()\n\t\tbody, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcode := errors.GeneralCode\n\t\tswitch resp.StatusCode {\n\t\tcase http.StatusUnauthorized:\n\t\t\tcode = errors.UnAuthorizedCode\n\t\tcase http.StatusForbidden:\n\t\t\tcode = errors.ForbiddenCode\n\t\tcase http.StatusNotFound:\n\t\t\tcode = errors.NotFoundCode\n\t\t}\n\t\treturn nil, errors.New(nil).WithCode(code).\n\t\t\tWithMessagef(\"http status code: %d, body: %s\", resp.StatusCode, string(body))\n\t}\n\treturn resp, nil\n}\n\nfunc buildManifestURL(endpoint, repository, reference string) string {\n\treturn fmt.Sprintf(\"%s/api/registry/%s/manifests/%s\", endpoint, repository, reference)\n}\n\nfunc buildBlobURL(endpoint, reference string) string {\n\treturn fmt.Sprintf(\"%s/api/registry/blob/%s\", endpoint, reference)\n}\n","sourceCodeStart":118,"sourceCodeEnd":149,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/registryctl/client/client.go#L118-L149","documentation":"Error \"http status code: %d, body: %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/registryctl/client/client.go:136 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"}