From 80ce3adfb634be3097c98c7897a5ddf63cd2441a Mon Sep 17 00:00:00 2001 From: ivcosla Date: Wed, 17 Apr 2019 15:11:41 +0200 Subject: [PATCH] better error log --- pkg/setup/mock_node_test.go | 3 +++ pkg/setup/protocol.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/setup/mock_node_test.go b/pkg/setup/mock_node_test.go index d28f5974fa..47dd301e5d 100644 --- a/pkg/setup/mock_node_test.go +++ b/pkg/setup/mock_node_test.go @@ -6,6 +6,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "sync" "testing" "time" @@ -245,8 +246,10 @@ func (n *mockNode) serveTransport(tr transport.Transport) error { proto := NewSetupProtocol(tr) sp, data, err := proto.ReadPacket() if err != nil { + fmt.Println("mockNode @ serveTransport => proto.ReadPacket(): err ", err) return err } + fmt.Println("mockNode @ serveTransport => proto.ReadPacket(): correct ", sp) n.Lock() switch sp { diff --git a/pkg/setup/protocol.go b/pkg/setup/protocol.go index 8acb32691e..58db0de7c0 100644 --- a/pkg/setup/protocol.go +++ b/pkg/setup/protocol.go @@ -192,7 +192,7 @@ func readAndDecodePacket(p *Protocol, v interface{}) error { return err } if t == RespFailure { - return errors.New(string(t)) + return errors.New("RespFailure, packet type: " + t.String()) } if v == nil { return nil