mirror of
https://github.com/rclone/rclone.git
synced 2026-01-04 09:33:36 +00:00
Fix error counter - fixes #3650
For few commands, RClone counts a error multiple times. This was fixed by creating a new error type which keeps a flag to remember if the error has already been counted or not. The CountError function now wraps the original error eith the above new error type and returns it.
This commit is contained in:
committed by
Nick Craig-Wood
parent
19229b1215
commit
75a6c49f87
@@ -34,7 +34,7 @@ outer:
|
||||
_, err := f.NewObject(ctx, newName)
|
||||
for ; err != fs.ErrorObjectNotFound; suffix++ {
|
||||
if err != nil {
|
||||
fs.CountError(err)
|
||||
err = fs.CountError(err)
|
||||
fs.Errorf(o, "Failed to check for existing object: %v", err)
|
||||
continue outer
|
||||
}
|
||||
@@ -48,7 +48,7 @@ outer:
|
||||
if !fs.Config.DryRun {
|
||||
newObj, err := doMove(ctx, o, newName)
|
||||
if err != nil {
|
||||
fs.CountError(err)
|
||||
err = fs.CountError(err)
|
||||
fs.Errorf(o, "Failed to rename: %v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user