From 1b001e3dc76b6950f6170a1b2f01bf9c50d230ef Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 2 Jul 2021 21:27:11 +0300 Subject: [PATCH] Less ambiguous error for unknown node id --- src/node.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node.go b/src/node.go index f5bea18..b2a5985 100644 --- a/src/node.go +++ b/src/node.go @@ -20,6 +20,7 @@ package nncp import ( "crypto/rand" "errors" + "fmt" "sync" "time" @@ -114,7 +115,7 @@ func (nodeOur *NodeOur) Their() *Node { func NodeIdFromString(raw string) (*NodeId, error) { decoded, err := Base32Codec.DecodeString(raw) if err != nil { - return nil, err + return nil, fmt.Errorf("Can not parse node: %s: %s", raw, err) } if len(decoded) != blake2b.Size256 { return nil, errors.New("Invalid node id size") -- 2.44.0