mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
repository: cleanup error message on invalid data
The retry printed the filename twice: ``` Load(<lock/04804cba82>, 0, 0) returned error, retrying after 720.254544ms: load(<lock/04804cba82>): invalid data returned ``` now the warning has changed to ``` Load(<lock/04804cba82>, 0, 0) returned error, retrying after 720.254544ms: invalid data returned ```
This commit is contained in:
parent
5f97f534b1
commit
6d9675c323
@ -204,7 +204,8 @@ func (r *Repository) LoadUnpacked(ctx context.Context, t restic.FileType, id res
|
|||||||
} else {
|
} else {
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
return errors.Errorf("load(%v): invalid data returned", h)
|
return restic.ErrInvalidData
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
@ -4,10 +4,14 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/crypto"
|
"github.com/restic/restic/internal/crypto"
|
||||||
|
"github.com/restic/restic/internal/errors"
|
||||||
"github.com/restic/restic/internal/ui/progress"
|
"github.com/restic/restic/internal/ui/progress"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ErrInvalidData is used to report that a file is corrupted
|
||||||
|
var ErrInvalidData = errors.New("invalid data returned")
|
||||||
|
|
||||||
// Repository stores data in a backend. It provides high-level functions and
|
// Repository stores data in a backend. It provides high-level functions and
|
||||||
// transparently encrypts/decrypts data.
|
// transparently encrypts/decrypts data.
|
||||||
type Repository interface {
|
type Repository interface {
|
||||||
|
Loading…
Reference in New Issue
Block a user