Skip to content

Commit

Permalink
better error log
Browse files Browse the repository at this point in the history
  • Loading branch information
ivcosla committed Apr 17, 2019
1 parent 63a80b0 commit 80ce3ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/setup/mock_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/setup/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80ce3ad

Please sign in to comment.