From f8180447a198bbfc872f834eb5fb9e89ad19e243 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 21 Oct 2022 22:03:24 +0300 Subject: [PATCH] [#1938] meta: Make version error messages more descriptive Signed-off-by: Pavel Karpy --- pkg/local_object_storage/metabase/version.go | 2 +- pkg/local_object_storage/shard/control.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/metabase/version.go b/pkg/local_object_storage/metabase/version.go index e4c29cd7..df198160 100644 --- a/pkg/local_object_storage/metabase/version.go +++ b/pkg/local_object_storage/metabase/version.go @@ -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 diff --git a/pkg/local_object_storage/shard/control.go b/pkg/local_object_storage/shard/control.go index fd1f8811..1378d497 100644 --- a/pkg/local_object_storage/shard/control.go +++ b/pkg/local_object_storage/shard/control.go @@ -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)