]> Cypherpunks.ru repositories - nncp.git/commitdiff
Less ambiguous error for unknown node id
authorSergey Matveev <stargrave@stargrave.org>
Fri, 2 Jul 2021 18:27:11 +0000 (21:27 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 2 Jul 2021 18:37:54 +0000 (21:37 +0300)
src/node.go

index f5bea183cce561b972dc009f4d440a0479082d0e..b2a598546d54b72e41c1fbc05f601a227b6c964c 100644 (file)
@@ -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")