Add more context to an error

This commit is contained in:
Matt Joiner 2018-06-26 20:24:39 +10:00
parent 57849844ae
commit 6212973011
1 changed files with 3 additions and 0 deletions

View File

@ -1116,6 +1116,9 @@ func (c *connection) mainReadLoop() (err error) {
if len(msg.Piece) == int(t.chunkSize) {
t.chunkPool.Put(&msg.Piece)
}
if err != nil {
err = fmt.Errorf("receiving chunk: %s", err)
}
case pp.Extended:
err = c.onReadExtendedMsg(msg.ExtendedID, msg.ExtendedPayload)
case pp.Port: