From 443860c41eb8f03981a5671bad0ac4cf2e6491ef Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Fri, 14 Jul 2023 14:28:45 -0400 Subject: [Bugfix] Properly handle errors from filling data series Checking a previously defined/set error value in most cases when filling in a data series. This patch properly redefines the error variable so that the appropriate check is made. Signed-off-by: Will Hawkins --- networkQuality.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/networkQuality.go b/networkQuality.go index 3bd6767..a2933a3 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -690,15 +690,16 @@ func main() { if err := selfRtts.Fill(bucket, selfDataPoint.Duration.Seconds()); err != nil { fmt.Printf("Attempting to fill a bucket (id: %d) that does not exist (selfRtts)\n", bucket) } - if perDirectionSelfRtts.Fill(bucket, selfDataPoint.Duration.Seconds()); err != nil { + if err := perDirectionSelfRtts.Fill(bucket, + selfDataPoint.Duration.Seconds()); err != nil { fmt.Printf("Attempting to fill a bucket (id: %d) that does not exist (perDirectionSelfRtts)\n", bucket) } - if foreignRtts.Fill(bucket, foreignDataPoint.Duration.Seconds()); err != nil { + if err := foreignRtts.Fill(bucket, foreignDataPoint.Duration.Seconds()); err != nil { fmt.Printf("Attempting to fill a bucket (id: %d) that does not exist (foreignRtts)\n", bucket) } - if perDirectionForeignRtts.Fill(bucket, + if err := perDirectionForeignRtts.Fill(bucket, foreignDataPoint.Duration.Seconds()); err != nil { fmt.Printf("Attempting to fill a bucket (id: %d) that does not exist (perDirectionForeignRtts)\n", bucket) } -- cgit v1.2.3