diff --git a/providers/dns/namesilo/namesilo.go b/providers/dns/namesilo/namesilo.go index ca0ba67b47..450c3d68c6 100644 --- a/providers/dns/namesilo/namesilo.go +++ b/providers/dns/namesilo/namesilo.go @@ -134,16 +134,18 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error { return fmt.Errorf("namesilo: %w", err) } - var lastErr error for _, r := range resp.Reply.ResourceRecord { if r.Type == "TXT" && r.Value == info.Value && (r.Host == subdomain || r.Host == dns01.UnFqdn(info.EffectiveFQDN)) { _, err := d.client.DnsDeleteRecord(&namesilo.DnsDeleteRecordParams{Domain: zoneName, ID: r.RecordID}) if err != nil { - lastErr = fmt.Errorf("namesilo: %w", err) + return fmt.Errorf("namesilo: %w", err) } + + return nil } } - return lastErr + + return fmt.Errorf("namesilo: no TXT record to delete for %s (%s)", info.EffectiveFQDN, info.Value) } // Timeout returns the timeout and interval to use when checking for DNS propagation.