diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-07-16 23:39:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 23:39:27 -0700 |
| commit | 69553e5ba6d46ed924b0c3adc3f8d9666550999a (patch) | |
| tree | 7711c4d9fe1919d2c6eaa841779bcde6e24b0248 /weed/filer/remote_mapping.go | |
| parent | a524b4f485ce5aa2f234c742bd7d1e75386f569b (diff) | |
| download | seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.tar.xz seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.zip | |
convert error fromating to %w everywhere (#6995)
Diffstat (limited to 'weed/filer/remote_mapping.go')
| -rw-r--r-- | weed/filer/remote_mapping.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/weed/filer/remote_mapping.go b/weed/filer/remote_mapping.go index c8adbeb4d..cc48d859e 100644 --- a/weed/filer/remote_mapping.go +++ b/weed/filer/remote_mapping.go @@ -16,13 +16,13 @@ func ReadMountMappings(grpcDialOption grpc.DialOption, filerAddress pb.ServerAdd return readErr }); readErr != nil { if readErr != filer_pb.ErrNotFound { - return nil, fmt.Errorf("read existing mapping: %v", readErr) + return nil, fmt.Errorf("read existing mapping: %w", readErr) } oldContent = nil } mappings, readErr = UnmarshalRemoteStorageMappings(oldContent) if readErr != nil { - return nil, fmt.Errorf("unmarshal mappings: %v", readErr) + return nil, fmt.Errorf("unmarshal mappings: %w", readErr) } return @@ -38,7 +38,7 @@ func InsertMountMapping(filerClient filer_pb.FilerClient, dir string, remoteStor }) if err != nil { if err != filer_pb.ErrNotFound { - return fmt.Errorf("read existing mapping: %v", err) + return fmt.Errorf("read existing mapping: %w", err) } } @@ -53,7 +53,7 @@ func InsertMountMapping(filerClient filer_pb.FilerClient, dir string, remoteStor return SaveInsideFiler(client, DirectoryEtcRemote, REMOTE_STORAGE_MOUNT_FILE, newContent) }) if err != nil { - return fmt.Errorf("save mapping: %v", err) + return fmt.Errorf("save mapping: %w", err) } return nil @@ -69,7 +69,7 @@ func DeleteMountMapping(filerClient filer_pb.FilerClient, dir string) (err error }) if err != nil { if err != filer_pb.ErrNotFound { - return fmt.Errorf("read existing mapping: %v", err) + return fmt.Errorf("read existing mapping: %w", err) } } @@ -84,7 +84,7 @@ func DeleteMountMapping(filerClient filer_pb.FilerClient, dir string) (err error return SaveInsideFiler(client, DirectoryEtcRemote, REMOTE_STORAGE_MOUNT_FILE, newContent) }) if err != nil { - return fmt.Errorf("save mapping: %v", err) + return fmt.Errorf("save mapping: %w", err) } return nil @@ -100,7 +100,7 @@ func addRemoteStorageMapping(oldContent []byte, dir string, storageLocation *rem mappings.Mappings[dir] = storageLocation if newContent, err = proto.Marshal(mappings); err != nil { - return oldContent, fmt.Errorf("marshal mappings: %v", err) + return oldContent, fmt.Errorf("marshal mappings: %w", err) } return @@ -116,7 +116,7 @@ func removeRemoteStorageMapping(oldContent []byte, dir string) (newContent []byt delete(mappings.Mappings, dir) if newContent, err = proto.Marshal(mappings); err != nil { - return oldContent, fmt.Errorf("marshal mappings: %v", err) + return oldContent, fmt.Errorf("marshal mappings: %w", err) } return |
