local, yandex, dropbox: fix NewObject suceeding on a directory #1079

Add tests to make it consistent across all remotes
This commit is contained in:
Nick Craig-Wood
2017-02-25 11:09:57 +00:00
parent 527099ae72
commit 79e3c67bbd
20 changed files with 66 additions and 34 deletions
+1 -3
View File
@@ -480,9 +480,7 @@ func (o *Object) stat() error {
return errors.Wrap(err, "stat failed")
}
if info.IsDir() {
// FIXME this error message doesn't seem right, but it
// is necessary for the NewFS code
return fs.ErrorObjectNotFound
return errors.Wrapf(fs.ErrorNotAFile, "%q", o.remote)
}
o.info = info
return nil