Skip to content

Commit e1525ce

Browse files
committed
fix(file-and-folder-exists): Log errors differ than IsNotExist
1 parent d15192e commit e1525ce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/csi-s3/pkg/s3/util.go

+8
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ func FileExists(filename string) bool {
134134
if os.IsNotExist(err) {
135135
return false
136136
}
137+
if err != nil {
138+
glog.Errorf("Error checking if file exists: %v", err)
139+
return false
140+
}
137141
return !info.IsDir()
138142
}
139143

@@ -142,6 +146,10 @@ func FolderExists(path string) bool {
142146
if os.IsNotExist(err) {
143147
return false
144148
}
149+
if err != nil {
150+
glog.Errorf("Error checking if folder exists: %v", err)
151+
return false
152+
}
145153
return info.IsDir()
146154
}
147155

0 commit comments

Comments
 (0)