summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2023-07-14 14:28:45 -0400
committerWill Hawkins <[email protected]>2023-07-14 14:28:45 -0400
commit443860c41eb8f03981a5671bad0ac4cf2e6491ef (patch)
tree10049b29071595e9884e607fb40be04642d10fa0
parenta422c6266cf9fbc8e8eef518ec769e86472eedb8 (diff)
[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 <[email protected]>
-rw-r--r--networkQuality.go7
1 files 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)
}