Skip to content

Commit

Permalink
check crc print err
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Jul 27, 2022
1 parent 5bbe2a2 commit 5210297
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions object.go
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,9 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string

if resp != nil && s.client.Conf.EnableCRC && !opt.DisableChecksum {
scoscrc := resp.Header.Get("x-cos-hash-crc64ecma")
icoscrc, _ := strconv.ParseUint(scoscrc, 10, 64)
icoscrc, err := strconv.ParseUint(scoscrc, 10, 64)
if icoscrc != localcrc {
return v, resp, fmt.Errorf("verification failed, want:%v, return:%v", localcrc, icoscrc)
return v, resp, fmt.Errorf("verification failed, want:%v, return:%v, x-cos-hash-crc64ecma: %v, err:%v", localcrc, icoscrc, scoscrc, err)
}
}
return v, resp, err
Expand Down

0 comments on commit 5210297

Please sign in to comment.