{"record":{"id":"54c607c247afb904","repo":"goharbor/harbor","slug":"http-status-code-d-body-s-54c607","errorCode":null,"errorMessage":"http status code: %d, body: %s","messagePattern":"http status code: (.+?), body: (.+?)","errorType":"http","errorClass":"lib/errors.Error","httpStatus":null,"severity":"error","filePath":"src/pkg/registry/client.go","lineNumber":669,"sourceCode":"\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\tcase http.StatusTooManyRequests:\n\t\t\tcode = errors.RateLimitCode\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 (c *client) ListReferrers(repository, digest string, rawQuery string) (*v1.Index, map[string][]string, error) {\n\tremoteURL := buildReferrersURL(c.url, repository, digest, rawQuery)\n\treq, err := http.NewRequest(http.MethodGet, remoteURL, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tlog.Debugf(\"upstream url %v\", remoteURL)\n\n\tif c.authorizer == nil {\n\t\tlog.Debug(\"registry client authorizer is nil\") // only log this case, not an error\n\t}\n\n\tresp, err := c.do(req)","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/registry/client.go#L651-L687","documentation":"Error \"http status code: %d, body: %s\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/registry/client.go:669 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"}