fix(fetcher): handle all os.Stat() errors
This commit is contained in:
parent
37de3302c6
commit
f2dc3d5174
@ -75,7 +75,7 @@ func getDockerComposeViaHTTP(url string) (*dockerCompose.Config, error) {
|
|||||||
func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) {
|
func readDockerComposeFromFile(name string) (*dockerCompose.Config, error) {
|
||||||
fileStat, err := os.Stat(name)
|
fileStat, err := os.Stat(name)
|
||||||
switch {
|
switch {
|
||||||
case errors.Is(err, os.ErrNotExist):
|
case err != nil:
|
||||||
return nil, err
|
return nil, err
|
||||||
case fileStat.IsDir():
|
case fileStat.IsDir():
|
||||||
return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name)
|
return nil, fmt.Errorf("%w: %s", ErrorPathIsDir, name)
|
||||||
|
Loading…
Reference in New Issue
Block a user