mirror of
https://github.com/restic/restic.git
synced 2024-12-22 07:43:03 +00:00
s3: Fix sanity check
The sanity check shouldn't replace the error message if there is already one.
This commit is contained in:
parent
29e39e247a
commit
95b7f8dd81
1 changed files with 1 additions and 1 deletions
|
@ -277,7 +277,7 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe
|
||||||
debug.Log("%v -> %v bytes, err %#v: %v", objName, info.Size, err, err)
|
debug.Log("%v -> %v bytes, err %#v: %v", objName, info.Size, err, err)
|
||||||
|
|
||||||
// sanity check
|
// sanity check
|
||||||
if err != nil && info.Size != rd.Length() {
|
if err == nil && info.Size != rd.Length() {
|
||||||
return errors.Errorf("wrote %d bytes instead of the expected %d bytes", info.Size, rd.Length())
|
return errors.Errorf("wrote %d bytes instead of the expected %d bytes", info.Size, rd.Length())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue