From: Sergey Matveev Date: Fri, 2 Jul 2021 18:27:11 +0000 (+0300) Subject: Less ambiguous error for unknown node id X-Git-Tag: v7.1.0^2~11 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=1b001e3dc76b6950f6170a1b2f01bf9c50d230ef;p=nncp.git Less ambiguous error for unknown node id --- 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")