Add errors through result.AddError()

This commit is contained in:
TwinProduction 2021-06-05 18:51:51 -04:00
parent 8997eeef05
commit e214d56af1
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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)