goharbor/harbor · error · errors.Error

http status code: %d, body: %s

Error message

http status code: %d, body: %s

What it means

Error "http status code: %d, body: %s" thrown in goharbor/harbor.

Source

Thrown at src/registryctl/client/client.go:136

	if err != nil {
		return nil, err
	}
	if resp.StatusCode < 200 || resp.StatusCode > 299 {
		defer resp.Body.Close()
		body, err := io.ReadAll(resp.Body)
		if err != nil {
			return nil, err
		}
		code := errors.GeneralCode
		switch resp.StatusCode {
		case http.StatusUnauthorized:
			code = errors.UnAuthorizedCode
		case http.StatusForbidden:
			code = errors.ForbiddenCode
		case http.StatusNotFound:
			code = errors.NotFoundCode
		}
		return nil, errors.New(nil).WithCode(code).
			WithMessagef("http status code: %d, body: %s", resp.StatusCode, string(body))
	}
	return resp, nil
}

func buildManifestURL(endpoint, repository, reference string) string {
	return fmt.Sprintf("%s/api/registry/%s/manifests/%s", endpoint, repository, reference)
}

func buildBlobURL(endpoint, reference string) string {
	return fmt.Sprintf("%s/api/registry/blob/%s", endpoint, reference)
}

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/registryctl/client/client.go:136 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/d68e8bf717060e2b. Report an issue: GitHub.