diff --git a/restic.go b/restic.go index fcb2829..d95599f 100644 --- a/restic.go +++ b/restic.go @@ -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 diff --git a/restic_test.go b/restic_test.go index 40ccda4..350dc00 100644 --- a/restic_test.go +++ b/restic_test.go @@ -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