mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 15:30:06 +08:00
opendrive: fix List on a just deleted and remade directory
Sometimes opendrive reports "403 Folder is already deleted" on directories which should exist. This might be a bug in opendrive or in rclone however we work-around here sufficient to get the tests passing.
This commit is contained in:
parent
257607ab3d
commit
db37b3ef9e
|
@ -767,6 +767,17 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
|
|||
return f.shouldRetry(ctx, resp, err)
|
||||
})
|
||||
if err != nil {
|
||||
if apiError, ok := err.(*Error); ok {
|
||||
// Work around a bug maybe in opendrive or maybe in rclone.
|
||||
//
|
||||
// We should know whether the folder exists or not by the call to
|
||||
// FindDir above so exactly why it is not found here is a mystery.
|
||||
//
|
||||
// This manifests as a failure in fs/sync TestSyncOverlapWithFilter
|
||||
if apiError.Info.Message == "Folder is already deleted" {
|
||||
return fs.DirEntries{}, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("failed to get folder list: %w", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user