forked from TrueCloudLab/restic
Improve error messages
This commit is contained in:
parent
7797e084f9
commit
0492eabff1
1 changed files with 2 additions and 2 deletions
|
@ -56,12 +56,12 @@ func (r *Repository) LoadAndDecrypt(t restic.FileType, id restic.ID) ([]byte, er
|
||||||
h := restic.Handle{Type: t, Name: id.String()}
|
h := restic.Handle{Type: t, Name: id.String()}
|
||||||
buf, err := backend.LoadAll(r.be, h)
|
buf, err := backend.LoadAll(r.be, h)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
debug.Log("error loading %v: %v", id.Str(), err)
|
debug.Log("error loading %v: %v", h, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if t != restic.ConfigFile && !restic.Hash(buf).Equal(id) {
|
if t != restic.ConfigFile && !restic.Hash(buf).Equal(id) {
|
||||||
return nil, errors.New("invalid data returned")
|
return nil, errors.Errorf("%v: invalid data returned", h)
|
||||||
}
|
}
|
||||||
|
|
||||||
// decrypt
|
// decrypt
|
||||||
|
|
Loading…
Reference in a new issue