From: Matt Joiner Date: Tue, 26 Jun 2018 10:24:39 +0000 (+1000) Subject: Add more context to an error X-Git-Tag: v1.0.0~115 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=6212973011136ee431cae8cd9e0e7286cde7efa2;p=btrtrc.git Add more context to an error --- diff --git a/connection.go b/connection.go index 24da542b..63a0da6b 100644 --- a/connection.go +++ b/connection.go @@ -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: