@@ -628,7 +628,7 @@ func (s *ObjectService) Append(ctx context.Context, name string, position int, r
628628 if s .client .Conf .EnableCRC && reader .writer != nil {
629629 wanted := hex .EncodeToString (reader .Sum ())
630630 if wanted != resp .Header .Get ("x-cos-content-sha1" ) {
631- return res , resp , fmt .Errorf ("append verification failed, want:%v, return:%v" , wanted , resp .Header .Get ("x-cos-content-sha1" ))
631+ return res , resp , fmt .Errorf ("append verification failed, want:%v, return:%v, header:%+v " , wanted , resp .Header .Get ("x-cos-content-sha1" ), resp . Header )
632632 }
633633 }
634634 np , err := strconv .ParseInt (resp .Header .Get ("x-cos-next-append-position" ), 10 , 64 )
@@ -1063,7 +1063,7 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
10631063 scoscrc := rsp .Header .Get ("x-cos-hash-crc64ecma" )
10641064 icoscrc , _ := strconv .ParseUint (scoscrc , 10 , 64 )
10651065 if icoscrc != localcrc {
1066- return result , rsp , fmt .Errorf ("verification failed, want:%v, return:%v" , localcrc , icoscrc )
1066+ return result , rsp , fmt .Errorf ("verification failed, want:%v, return:%v, header:%+v " , localcrc , icoscrc , rsp . Header )
10671067 }
10681068 }
10691069 return result , rsp , nil
@@ -1196,7 +1196,7 @@ func (s *ObjectService) Upload(ctx context.Context, name string, filepath string
11961196 scoscrc := resp .Header .Get ("x-cos-hash-crc64ecma" )
11971197 icoscrc , err := strconv .ParseUint (scoscrc , 10 , 64 )
11981198 if icoscrc != localcrc {
1199- return v , resp , fmt .Errorf ("verification failed, want:%v, return:%v, x-cos-hash-crc64ecma: %v, err:%v" , localcrc , icoscrc , scoscrc , err )
1199+ return v , resp , fmt .Errorf ("verification failed, want:%v, return:%v, x-cos-hash-crc64ecma: %v, err:%v, header:%+v " , localcrc , icoscrc , scoscrc , err , resp . Header )
12001200 }
12011201 }
12021202 return v , resp , err
@@ -1330,7 +1330,7 @@ func (s *ObjectService) Download(ctx context.Context, name string, filepath stri
13301330 return rsp , err
13311331 }
13321332 if localcrc != icoscrc {
1333- return rsp , fmt .Errorf ("verification failed, want:%v, return:%v" , icoscrc , localcrc )
1333+ return rsp , fmt .Errorf ("verification failed, want:%v, return:%v, header:%+v " , icoscrc , localcrc , resp . Header )
13341334 }
13351335 }
13361336 return rsp , err
@@ -1449,7 +1449,7 @@ func (s *ObjectService) Download(ctx context.Context, name string, filepath stri
14491449 return resp , err
14501450 }
14511451 if localcrc != icoscrc {
1452- return resp , fmt .Errorf ("verification failed, want:%v, return:%v" , icoscrc , localcrc )
1452+ return resp , fmt .Errorf ("verification failed, want:%v, return:%v, header:%+v " , icoscrc , localcrc , resp . Header )
14531453 }
14541454 }
14551455 return resp , err
0 commit comments