forked from TrueCloudLab/restic
stat: Improve error message for bad snapshot ID (fixes #1933)
This commit is contained in:
parent
beb208e159
commit
6f5b0f3622
2 changed files with 3 additions and 3 deletions
|
@ -100,13 +100,13 @@ func runStats(gopts GlobalOptions, args []string) error {
|
||||||
} else {
|
} else {
|
||||||
sID, err = restic.FindSnapshot(repo, snapshotIDString)
|
sID, err = restic.FindSnapshot(repo, snapshotIDString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
Exitf(1, "error loading snapshot: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshot, err := restic.LoadSnapshot(ctx, repo, sID)
|
snapshot, err := restic.LoadSnapshot(ctx, repo, sID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
Exitf(1, "error loading snapshot from repo: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = statsWalkSnapshot(ctx, snapshot, repo, stats)
|
err = statsWalkSnapshot(ctx, snapshot, repo, stats)
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
// ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix
|
// ErrNoIDPrefixFound is returned by Find() when no ID for the given prefix
|
||||||
// could be found.
|
// 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
|
// ErrMultipleIDMatches is returned by Find() when multiple IDs with the given
|
||||||
// prefix are found.
|
// prefix are found.
|
||||||
|
|
Loading…
Add table
Reference in a new issue