stat: Improve error message for bad snapshot ID (fixes #1933)

This commit is contained in:
Matthew Holt 2018-08-08 16:49:36 -06:00
parent beb208e159
commit 6f5b0f3622
2 changed files with 3 additions and 3 deletions

View File

@ -100,13 +100,13 @@ func runStats(gopts GlobalOptions, args []string) error {
} else {
sID, err = restic.FindSnapshot(repo, snapshotIDString)
if err != nil {
return err
Exitf(1, "error loading snapshot: %v", err)
}
}
snapshot, err := restic.LoadSnapshot(ctx, repo, sID)
if err != nil {
return err
Exitf(1, "error loading snapshot from repo: %v", err)
}
err = statsWalkSnapshot(ctx, snapshot, repo, stats)

View File

@ -8,7 +8,7 @@ import (
// ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix
// could be found.
var ErrNoIDPrefixFound = errors.New("no ID found")
var ErrNoIDPrefixFound = errors.New("no matching ID found")
// ErrMultipleIDMatches is returned by Find() when multiple IDs with the given
// prefix are found.