Translate storage access denied error to S3 Access Denied response (#3015)

This commit is contained in:
Anis Elleuch
2016-10-21 00:09:55 +01:00
committed by Harshavardhana
parent 8876e0a80a
commit 41f9ab1c69
7 changed files with 145 additions and 6 deletions

View File

@@ -115,6 +115,9 @@ func readDir(dirPath string) (entries []string, err error) {
if os.IsNotExist(err) {
return nil, errFileNotFound
}
if os.IsPermission(err) {
return nil, errFileAccessDenied
}
// File path cannot be verified since one of the parents is a file.
if strings.Contains(err.Error(), "not a directory") {