From e214d56af19e70c182ea0cc7af9d45d36620cc37 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sat, 5 Jun 2021 18:51:51 -0400 Subject: [PATCH] Add errors through result.AddError() --- core/dns.go | 2 +- core/service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dns.go b/core/dns.go index d8011925..2067ea3a 100644 --- a/core/dns.go +++ b/core/dns.go @@ -52,7 +52,7 @@ func (d *DNS) query(url string, result *Result) { m.SetQuestion(d.QueryName, queryType) r, _, err := c.Exchange(m, url) if err != nil { - result.Errors = append(result.Errors, err.Error()) + result.AddError(err.Error()) return } result.Connected = true diff --git a/core/service.go b/core/service.go index 5545dc9d..067ea26c 100644 --- a/core/service.go +++ b/core/service.go @@ -195,7 +195,7 @@ func (service *Service) call(result *Result) { } else if isServiceStartTLS { result.Connected, certificate, err = client.CanPerformStartTLS(strings.TrimPrefix(service.URL, "starttls://"), service.Insecure) if err != nil { - result.Errors = append(result.Errors, err.Error()) + result.AddError(err.Error()) return } result.Duration = time.Since(startTime)