Compare commits
1 commit
tcl/master
...
fix-dropbo
Author | SHA1 | Date | |
---|---|---|---|
|
4660f5f15d |
1 changed files with 27 additions and 0 deletions
|
@ -1078,6 +1078,15 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
|
|||
return shouldRetry(ctx, err)
|
||||
})
|
||||
if err != nil {
|
||||
switch e := err.(type) {
|
||||
case files.CopyV2APIError:
|
||||
// If we are doing a cross remote transfer then from_lookup/not_found indicates we
|
||||
// don't have permission to read the source, so engage the slow path
|
||||
if srcObj.fs != f && e.EndpointError != nil && e.EndpointError.FromLookup != nil && e.EndpointError.FromLookup.Tag == files.LookupErrorNotFound {
|
||||
fs.Debugf(srcObj, "Copy failed attempting fallback: %v", err)
|
||||
return nil, fs.ErrorCantCopy
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("copy failed: %w", err)
|
||||
}
|
||||
|
||||
|
@ -1139,6 +1148,15 @@ func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object,
|
|||
return shouldRetry(ctx, err)
|
||||
})
|
||||
if err != nil {
|
||||
switch e := err.(type) {
|
||||
case files.MoveV2APIError:
|
||||
// If we are doing a cross remote transfer then from_lookup/not_found indicates we
|
||||
// don't have permission to read the source, so engage the slow path
|
||||
if srcObj.fs != f && e.EndpointError != nil && e.EndpointError.FromLookup != nil && e.EndpointError.FromLookup.Tag == files.LookupErrorNotFound {
|
||||
fs.Debugf(srcObj, "Move failed attempting fallback: %v", err)
|
||||
return nil, fs.ErrorCantMove
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("move failed: %w", err)
|
||||
}
|
||||
|
||||
|
@ -1257,6 +1275,15 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string
|
|||
return shouldRetry(ctx, err)
|
||||
})
|
||||
if err != nil {
|
||||
switch e := err.(type) {
|
||||
case files.MoveV2APIError:
|
||||
// If we are doing a cross remote transfer then from_lookup/not_found indicates we
|
||||
// don't have permission to read the source, so engage the slow path
|
||||
if srcFs != f && e.EndpointError != nil && e.EndpointError.FromLookup != nil && e.EndpointError.FromLookup.Tag == files.LookupErrorNotFound {
|
||||
fs.Debugf(srcFs, "DirMove failed attempting fallback: %v", err)
|
||||
return fs.ErrorCantDirMove
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("MoveDir failed: %w", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue