[#1938] meta: Make version error messages more descriptive

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-10-21 22:03:24 +03:00 committed by fyrchik
parent f396ffcc0f
commit f8180447a1
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ var versionKey = []byte("version")
// ErrOutdatedVersion is returned on initializing
// an existing metabase that is not compatible with
// the current code version.
var ErrOutdatedVersion = errors.New("invalid version")
var ErrOutdatedVersion = errors.New("invalid version, resynchronization is required")
func checkVersion(tx *bbolt.Tx, initialized bool) error {
var knownVersion bool

View file

@ -117,7 +117,7 @@ func (s *Shard) Init() error {
if err := component.Init(); err != nil {
if component == s.metaBase {
if errors.Is(err, meta.ErrOutdatedVersion) {
return err
return fmt.Errorf("metabase initialization: %w", err)
}
err = s.handleMetabaseFailure("init", err)