From c30f69d1e9ed3b60861e655ec817d15bda0134c7 Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Sun, 30 Dec 2018 08:22:50 +0300 Subject: [PATCH] leech now correctly calls OnError when ext msg cannot be decoded --- cmd/magneticod/bittorrent/metadata/leech.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/magneticod/bittorrent/metadata/leech.go b/cmd/magneticod/bittorrent/metadata/leech.go index 8b3c5bb..fad486a 100644 --- a/cmd/magneticod/bittorrent/metadata/leech.go +++ b/cmd/magneticod/bittorrent/metadata/leech.go @@ -335,7 +335,7 @@ func (l *Leech) Do(deadline time.Time) { rExtDict := new(extDict) err = bencode.NewDecoder(rMessageBuf).Decode(rExtDict) if err != nil { - zap.L().Warn("Couldn't decode extension message in the loop!", zap.Error(err)) + l.OnError(errors.Wrap(err, "could not decode ext msg in the loop")) return }