p2p/protocols: log protocol spec on error

This commit is contained in:
Anton Evangelatov 2019-01-03 15:15:43 +01:00
parent f545e1ddad
commit a05e6d2d2f

View file

@ -298,7 +298,7 @@ func (p *Peer) Send(ctx context.Context, msg interface{}) error {
code, found := p.spec.GetCode(msg) code, found := p.spec.GetCode(msg)
if !found { if !found {
return errorf(ErrInvalidMsgType, "%v", code) return errorf(ErrInvalidMsgType, "%v %s", code, p.spec.Name)
} }
return p2p.Send(p.rw, code, wmsg) return p2p.Send(p.rw, code, wmsg)
} }