Add more descriptive errors for debugging
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a92ebc69ca
commit
8b5d15d4b2
@ -344,7 +344,7 @@ func (rcmd Restic) ReadSnapshots() ([]Snapshot, error) {
|
||||
snapshots := new([]Snapshot)
|
||||
|
||||
if err = json.Unmarshal([]byte(lines[0]), snapshots); err != nil {
|
||||
return nil, fmt.Errorf("failed parsing snapshot results: %w", err)
|
||||
return nil, fmt.Errorf("failed parsing snapshot results from %s: %w", lines[0], err)
|
||||
}
|
||||
|
||||
return *snapshots, nil
|
||||
|
@ -220,7 +220,7 @@ func TestResticInterface(t *testing.T) {
|
||||
// Make sure no existing repo is found
|
||||
_, err = restic.ReadSnapshots()
|
||||
if err == nil || !errors.Is(err, main.ErrRepoNotFound) {
|
||||
AssertEqualFail(t, "didn't get expected error for backup", main.ErrRepoNotFound, err)
|
||||
AssertEqualFail(t, "didn't get expected error for backup", main.ErrRepoNotFound.Error(), err.Error())
|
||||
}
|
||||
|
||||
// Try to backup when repo is not initialized
|
||||
|
Loading…
Reference in New Issue
Block a user