aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_sync.go
diff options
context:
space:
mode:
authorMax Denushev <mdenushev@ya.ru>2024-11-14 19:40:55 +0300
committerGitHub <noreply@github.com>2024-11-14 08:40:55 -0800
commita5fe6e21bce464017fde036160e986d4c3bb81db (patch)
tree4eee03e2651ab5cea1ad42d159e5220a43b6da2a /weed/command/filer_sync.go
parent3003c9e17e06db92f5a426c191ebaab15a1764a1 (diff)
downloadseaweedfs-a5fe6e21bce464017fde036160e986d4c3bb81db.tar.xz
seaweedfs-a5fe6e21bce464017fde036160e986d4c3bb81db.zip
feat(filer.backup): add ignore errors option (#6235)
* feat(filer.backup): add ignore errors option * feat(filer.backup): fix 404 error wrap * feat(filer.backup): fix wrapping function * feat(filer.backup): fix wrapping errors in genProcessFunction * Update weed/command/filer_backup.go * Update weed/command/filer_backup.go * Update weed/command/filer_backup.go --------- Co-authored-by: Max Denushev <denushev@tochka.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Diffstat (limited to 'weed/command/filer_sync.go')
-rw-r--r--weed/command/filer_sync.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index 90204af4a..8201aa712 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -436,7 +436,7 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
}
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
if err := dataSink.CreateEntry(key, message.NewEntry, message.Signatures); err != nil {
- return fmt.Errorf("create entry1 : %v", err)
+ return fmt.Errorf("create entry1 : %w", err)
} else {
return nil
}
@@ -462,13 +462,13 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
// not able to find old entry
if err = dataSink.DeleteEntry(string(oldKey), message.OldEntry.IsDirectory, false, message.Signatures); err != nil {
- return fmt.Errorf("delete old entry %v: %v", oldKey, err)
+ return fmt.Errorf("delete old entry %v: %w", oldKey, err)
}
}
// create the new entry
newKey := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
if err := dataSink.CreateEntry(newKey, message.NewEntry, message.Signatures); err != nil {
- return fmt.Errorf("create entry2 : %v", err)
+ return fmt.Errorf("create entry2 : %w", err)
} else {
return nil
}
@@ -486,7 +486,7 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
// new key is in the watched directory
key := buildKey(dataSink, message, targetPath, sourceNewKey, sourcePath)
if err := dataSink.CreateEntry(key, message.NewEntry, message.Signatures); err != nil {
- return fmt.Errorf("create entry3 : %v", err)
+ return fmt.Errorf("create entry3 : %w", err)
} else {
return nil
}