From 20554a58290da682bee01f61c0e59f81703988a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Jane=C5=BE?= Date: Mon, 1 Jun 2020 14:26:47 +0200 Subject: [PATCH] go/oasis-node/cmd/node: Make initGenesis()' errors more descriptive --- go/oasis-node/cmd/node/node.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/oasis-node/cmd/node/node.go b/go/oasis-node/cmd/node/node.go index 85ccffb37ba..4a3a0a27d8a 100644 --- a/go/oasis-node/cmd/node/node.go +++ b/go/oasis-node/cmd/node/node.go @@ -423,21 +423,21 @@ func (n *Node) initGenesis(testNode bool) error { // Well, there wasn't a genesis document and we're running unit tests, // so use a test node one. if n.Genesis, err = tendermintTestsGenesis.NewTestNodeGenesisProvider(n.Identity); err != nil { - return err + return fmt.Errorf("initGenesis: failed to create test node genesis: %w", err) } // In case of a test node, always use the test chain context. genesisTestHelpers.SetTestChainContext() return nil } - return err + return fmt.Errorf("initGenesis: failed to create local genesis file provider: %w", err) } // Retrieve the genesis document and use it to configure the ChainID for // signature domain separation. We do this as early as possible. genesisDoc, err := n.Genesis.GetGenesisDocument() if err != nil { - return err + return fmt.Errorf("initGenesis: failed to get genesis: %w", err) } genesisDoc.SetChainContext()