mirror of
https://github.com/TwiN/gatus.git
synced 2025-04-15 06:58:56 +02:00
Add errors through result.AddError()
This commit is contained in:
parent
8997eeef05
commit
e214d56af1
@ -52,7 +52,7 @@ func (d *DNS) query(url string, result *Result) {
|
|||||||
m.SetQuestion(d.QueryName, queryType)
|
m.SetQuestion(d.QueryName, queryType)
|
||||||
r, _, err := c.Exchange(m, url)
|
r, _, err := c.Exchange(m, url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result.Errors = append(result.Errors, err.Error())
|
result.AddError(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
result.Connected = true
|
result.Connected = true
|
||||||
|
@ -195,7 +195,7 @@ func (service *Service) call(result *Result) {
|
|||||||
} else if isServiceStartTLS {
|
} else if isServiceStartTLS {
|
||||||
result.Connected, certificate, err = client.CanPerformStartTLS(strings.TrimPrefix(service.URL, "starttls://"), service.Insecure)
|
result.Connected, certificate, err = client.CanPerformStartTLS(strings.TrimPrefix(service.URL, "starttls://"), service.Insecure)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result.Errors = append(result.Errors, err.Error())
|
result.AddError(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
result.Duration = time.Since(startTime)
|
result.Duration = time.Since(startTime)
|
||||||
|
Loading…
Reference in New Issue
Block a user