oras-go
oras-go copied to clipboard
improve the returned error of `oci.NewFromTar` when the passed-in path is not a tarfile
oci.NewFromTar can be used to create a new read-only OCI store from a tarfile path. If the passed-in path doesn't point to a tarfile, currently(v2.3.1) below errors will be returned:
- If the length of the file is zero, a
failed to open OCI layout file: oci-layout: file does not existerror will be returned - If the length of the file is not zero, an io.ErrUnexpectedEOF will be returned
As a user of oras-go SDK, I would like this function to return a unified and exported error type. Also, the error should indicate that the passed-in path doesn't point to an expected tarfile.