Merge pull request #2018 from dolanor/fix-missing-err-check
fix: add full error handling after os.Stat
This commit is contained in:
commit
893b8dad30
@ -35,6 +35,8 @@ func (t clientFilesystemReadTask) PreRun(_ context.Context, pctx *plancontext.Co
|
|||||||
return fmt.Errorf("path %q is not a directory", path)
|
return fmt.Errorf("path %q is not a directory", path)
|
||||||
case pi.IsDir() && !isFS:
|
case pi.IsDir() && !isFS:
|
||||||
return fmt.Errorf("path %q cannot be a directory", path)
|
return fmt.Errorf("path %q cannot be a directory", path)
|
||||||
|
case err != nil:
|
||||||
|
return fmt.Errorf("path %q cannot be stat'd: %w", path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if plancontext.IsFSValue(v.Lookup("contents")) {
|
if plancontext.IsFSValue(v.Lookup("contents")) {
|
||||||
|
Reference in New Issue
Block a user