go-containerregistry icon indicating copy to clipboard operation
go-containerregistry copied to clipboard

Returning the specific reason for the failure of ParseReference

Open UBarney opened this issue 2 years ago • 3 comments

I think it's better to return the specific reason for the failure of ParseReference, so that it is easier for users to debug. For example, when executing the following code, return the reason for the failure of NewTag (repo name cannot contain capital letters), so that the the user knows what went wrong and how to fix it (not everyone knows that repo names can't have capital letters...)

	err := crane.Push(nil, "badRepo:1.0")
	if err != nil {
		panic(err.Error())
	}

UBarney avatar Jun 26 '22 13:06 UBarney