From f18a2ce03aedaeea0e620ecb91b13a8d7c022ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tanguy=20=E2=A7=93=20Herrmann?= Date: Mon, 4 Apr 2022 13:32:19 +0200 Subject: [PATCH] fix: add full error handling after os.Stat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tanguy ⧓ Herrmann --- plan/task/clientfilesystemread.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plan/task/clientfilesystemread.go b/plan/task/clientfilesystemread.go index 3dc6a5e3..58933203 100644 --- a/plan/task/clientfilesystemread.go +++ b/plan/task/clientfilesystemread.go @@ -35,6 +35,8 @@ func (t clientFilesystemReadTask) PreRun(_ context.Context, pctx *plancontext.Co return fmt.Errorf("path %q is not a directory", path) case pi.IsDir() && !isFS: return fmt.Errorf("path %q cannot be a directory", path) + case err != nil: + return fmt.Errorf("path %q cannot be stat'd", path) } if plancontext.IsFSValue(v.Lookup("contents")) {