From 38b8665e9e8649f98e6162bdb5163172e6ecc187 Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Wed, 20 Sep 2023 08:22:31 -0700 Subject: [PATCH] perf net: Show the error with the bandwidth results (#4688) An error in the result does not mean that the whole perf net test failed, we can still show some results, with an error as well, to be less confusing to the user. --- cmd/speedtest-spinner.go | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/cmd/speedtest-spinner.go b/cmd/speedtest-spinner.go index d9c0d435..63776750 100644 --- a/cmd/speedtest-spinner.go +++ b/cmd/speedtest-spinner.go @@ -212,21 +212,12 @@ func (m *speedTestUI) View() string { }) } else { for _, nodeResult := range nres.NodeResults { - if nodeResult.Error != "" { - data = append(data, []string{ - trailerIfGreaterThan(nodeResult.Endpoint, 64), - crossTickCell, - crossTickCell, - "Err: " + nodeResult.Error, - }) - } else { - data = append(data, []string{ - trailerIfGreaterThan(nodeResult.Endpoint, 64), - whiteStyle.Render(humanize.IBytes(uint64(nodeResult.RX))) + "/s", - whiteStyle.Render(humanize.IBytes(uint64(nodeResult.TX))) + "/s", - "", - }) - } + data = append(data, []string{ + trailerIfGreaterThan(nodeResult.Endpoint, 64), + whiteStyle.Render(humanize.IBytes(uint64(nodeResult.RX))) + "/s", + whiteStyle.Render(humanize.IBytes(uint64(nodeResult.TX))) + "/s", + "Err: " + nodeResult.Error, + }) } }