mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
Cloud FS: don't propagate the error if removing a folder returns not found
for Cloud FS the folders are virtual and they, generally, disappear when the last file is removed. This fix doesn't work for FTP protocol for now. Fixes #149
This commit is contained in:
@@ -252,6 +252,10 @@ func (c *BaseConnection) RemoveDir(fsPath, virtualPath string) error {
|
||||
var fi os.FileInfo
|
||||
var err error
|
||||
if fi, err = c.Fs.Lstat(fsPath); err != nil {
|
||||
// see #149
|
||||
if c.Fs.IsNotExist(err) && c.Fs.HasVirtualFolders() {
|
||||
return nil
|
||||
}
|
||||
c.Log(logger.LevelWarn, "failed to remove a dir %#v: stat error: %+v", fsPath, err)
|
||||
return c.GetFsError(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user