From 40b0f9ca1e79bf1cab978ccc01f37ae8c5b32b38 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 20 Sep 2021 21:33:46 +1000 Subject: [PATCH] cmd/torrent: Include download stats on interrupt --- cmd/torrent/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 757ecdc7..385d732c 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -359,7 +359,7 @@ func downloadErr(flags downloadFlags) error { if client.WaitAll() { log.Print("downloaded ALL the torrents") } else { - return errors.New("y u no complete torrents?!") + err = errors.New("y u no complete torrents?!") } if flags.Seed { if len(client.Torrents()) == 0 { @@ -378,7 +378,7 @@ func downloadErr(flags downloadFlags) error { humanize.Bytes(uint64(clStats.BytesRead.Int64())), 100*float64(clStats.BytesReadUsefulData.Int64())/float64(clStats.BytesRead.Int64()), humanize.Bytes(uint64(sentOverhead))) - return nil + return err } func outputStats(cl *torrent.Client, args downloadFlags) {