aboutsummaryrefslogtreecommitdiff
path: root/weed/operation
diff options
context:
space:
mode:
Diffstat (limited to 'weed/operation')
-rw-r--r--weed/operation/assign_file_id.go4
-rw-r--r--weed/operation/chunked_file.go2
-rw-r--r--weed/operation/upload_content.go10
3 files changed, 8 insertions, 8 deletions
diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go
index eb54c674b..61fd2de48 100644
--- a/weed/operation/assign_file_id.go
+++ b/weed/operation/assign_file_id.go
@@ -80,7 +80,7 @@ func (ap *singleThreadAssignProxy) doAssign(grpcConnection *grpc.ClientConn, pri
ap.assignClient, err = client.StreamAssign(context.Background())
if err != nil {
ap.assignClient = nil
- return nil, fmt.Errorf("fail to create stream assign client: %v", err)
+ return nil, fmt.Errorf("fail to create stream assign client: %w", err)
}
}
@@ -105,7 +105,7 @@ func (ap *singleThreadAssignProxy) doAssign(grpcConnection *grpc.ClientConn, pri
WritableVolumeCount: request.WritableVolumeCount,
}
if err = ap.assignClient.Send(req); err != nil {
- return nil, fmt.Errorf("StreamAssignSend: %v", err)
+ return nil, fmt.Errorf("StreamAssignSend: %w", err)
}
resp, grpcErr := ap.assignClient.Recv()
if grpcErr != nil {
diff --git a/weed/operation/chunked_file.go b/weed/operation/chunked_file.go
index be3e5c98e..b0c6c651f 100644
--- a/weed/operation/chunked_file.go
+++ b/weed/operation/chunked_file.go
@@ -83,7 +83,7 @@ func (cm *ChunkManifest) DeleteChunks(masterFn GetMasterFn, usePublicUrl bool, g
results, err := DeleteFileIds(masterFn, usePublicUrl, grpcDialOption, fileIds)
if err != nil {
glog.V(0).Infof("delete %+v: %v", fileIds, err)
- return fmt.Errorf("chunk delete: %v", err)
+ return fmt.Errorf("chunk delete: %w", err)
}
for _, result := range results {
if result.Error != "" {
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 187fe6c3f..a48cf5ea2 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -129,7 +129,7 @@ func (uploader *Uploader) UploadWithRetry(filerClient filer_pb.FilerClient, assi
return nil
}); grpcAssignErr != nil {
- return fmt.Errorf("filerGrpcAddress assign volume: %v", grpcAssignErr)
+ return fmt.Errorf("filerGrpcAddress assign volume: %w", grpcAssignErr)
}
uploadOption.UploadUrl = genFileUrlFn(host, fileId)
@@ -171,7 +171,7 @@ func (uploader *Uploader) doUpload(ctx context.Context, reader io.Reader, option
} else {
data, err = io.ReadAll(reader)
if err != nil {
- err = fmt.Errorf("read input: %v", err)
+ err = fmt.Errorf("read input: %w", err)
return
}
}
@@ -245,7 +245,7 @@ func (uploader *Uploader) doUploadData(ctx context.Context, data []byte, option
cipherKey := util.GenCipherKey()
encryptedData, encryptionErr := util.Encrypt(data, cipherKey)
if encryptionErr != nil {
- err = fmt.Errorf("encrypt input: %v", encryptionErr)
+ err = fmt.Errorf("encrypt input: %w", encryptionErr)
return
}
@@ -389,13 +389,13 @@ func (uploader *Uploader) upload_content(ctx context.Context, fillBufferFunction
resp_body, ra_err := io.ReadAll(resp.Body)
if ra_err != nil {
- return nil, fmt.Errorf("read response body %v: %v", option.UploadUrl, ra_err)
+ return nil, fmt.Errorf("read response body %v: %w", option.UploadUrl, ra_err)
}
unmarshal_err := json.Unmarshal(resp_body, &ret)
if unmarshal_err != nil {
glog.ErrorfCtx(ctx, "unmarshal %s: %v", option.UploadUrl, string(resp_body))
- return nil, fmt.Errorf("unmarshal %v: %v", option.UploadUrl, unmarshal_err)
+ return nil, fmt.Errorf("unmarshal %v: %w", option.UploadUrl, unmarshal_err)
}
if ret.Error != "" {
return nil, fmt.Errorf("unmarshalled error %v: %v", option.UploadUrl, ret.Error)