From 2fc2f8792e971ed2b447d4dc6f186cb12a8f0dc9 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 24 Sep 2020 10:39:06 +0300 Subject: [PATCH] [#48] Make IR initial config errors more readable Signed-off-by: Alex Vanin --- pkg/innerring/innerring.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 66ea10a0..5da8762c 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -221,7 +221,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error err = initConfigFromBlockchain(server, contracts, &key.PublicKey) if err != nil { - return nil, err + return nil, errors.Wrap(err, "initializing error") } return server, nil @@ -304,13 +304,13 @@ func initConfigFromBlockchain(s *Server, c *contracts, key *ecdsa.PublicKey) err // get current epoch epoch, err := invoke.Epoch(s.morphClient, c.netmap) if err != nil { - return err + return errors.Wrap(err, "can't read epoch") } // check if node inside inner ring list state, err := invoke.IsInnerRing(s.mainnetClient, c.neofs, key) if err != nil { - return err + return errors.Wrap(err, "can't read inner ring list") } s.epochCounter.Store(uint64(epoch))