mirror of
https://github.com/containers/podman.git
synced 2025-12-05 12:52:12 +08:00
vendor of containers/(common, storage, image)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
7
vendor/github.com/containers/image/v5/docker/errors.go
generated
vendored
7
vendor/github.com/containers/image/v5/docker/errors.go
generated
vendored
@@ -47,7 +47,12 @@ func httpResponseToError(res *http.Response, context string) error {
|
||||
}
|
||||
|
||||
// registryHTTPResponseToError creates a Go error from an HTTP error response of a docker/distribution
|
||||
// registry
|
||||
// registry.
|
||||
//
|
||||
// WARNING: The OCI distribution spec says
|
||||
// “A `4XX` response code from the registry MAY return a body in any format.”; but if it is
|
||||
// JSON, it MUST use the errcode.Error structure.
|
||||
// So, callers should primarily decide based on HTTP StatusCode, not based on error type here.
|
||||
func registryHTTPResponseToError(res *http.Response) error {
|
||||
err := handleErrorResponse(res)
|
||||
// len(errs) == 0 should never be returned by handleErrorResponse; if it does, we don't modify it and let the caller report it as is.
|
||||
|
||||
Reference in New Issue
Block a user