mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 03:18:55 +00:00
stat: Improve error message for bad snapshot ID (fixes #1933)
This commit is contained in:
parent
beb208e159
commit
6f5b0f3622
@ -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)
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user