]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/node.go
Less ambiguous error for unknown node id
[nncp.git] / 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")