Openstatus www.openstatus.dev

fix dns error (#1613)

authored by

Thibault Le Ouay and committed by
GitHub
4276a55a 696008de

+5 -2
+5 -2
apps/checker/handlers/dns.go
··· 135 135 log.Ctx(ctx).Debug().Msgf("evaluating %d dns assertions", len(req.RawAssertions)) 136 136 isSuccessful, err = EvaluateDNSAssertions(req.RawAssertions, response) 137 137 if err != nil { 138 - return nil, backoff.Permanent(err) 138 + return response, backoff.Permanent(err) 139 139 } 140 140 } 141 141 if !isSuccessful && called < retry { ··· 150 150 151 151 result, err := backoff.Retry(ctx, op, backoff.WithBackOff(backoff.NewExponentialBackOff()), backoff.WithMaxTries(uint(retry))) 152 152 data.Latency = latency 153 - data.Records = FormatDNSResult(result) 153 + if result != nil { 154 + data.Records = FormatDNSResult(result) 155 + } 154 156 155 157 if len(req.RawAssertions) > 0 { 156 158 if j, err := json.Marshal(req.RawAssertions); err == nil { ··· 330 332 mx := make([]string, 0) 331 333 ns := make([]string, 0) 332 334 txt := make([]string, 0) 335 + 333 336 for _, v := range result.A { 334 337 a = append(a, v) 335 338 }