Skip to content

Commit 2dfb97f

Browse files
committedAug 5, 2023
a DNS error shouldn't be a fatal since other records might work
1 parent 15a4c59 commit 2dfb97f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎cmd/cli/multiregion/dns.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ func (d *DnsCommand) setCloudflareCname(name, value string) {
151151

152152
r, _, err := d.cfClient.ListDNSRecords(ctx, d.cfZone, cloudflare.ListDNSRecordsParams{Name: name + "." + d.domainName})
153153
if err != nil {
154-
log.Fatalf("error finding DNS record %s: %s", name, err)
154+
fmt.Printf("Error: Cloudflare API call failed to find DNS record %s: %s\n", name, err)
155+
return
155156
}
156157
if len(r) != 1 {
157-
log.Fatalf("did not find DNS record %s", name)
158+
fmt.Printf("Error: did not find DNS record %q in domain %q\n", name, d.domainName)
159+
return
158160
}
159161

160162
if r[0].Content == value {
@@ -179,6 +181,6 @@ func (d *DnsCommand) setCloudflareCname(name, value string) {
179181
Content: value,
180182
})
181183
if err != nil {
182-
log.Fatalf("error updating DNS record %s: %s", name, err)
184+
fmt.Printf("error updating DNS record %s: %s\nparams: %+v\n", name, err, params)
183185
}
184186
}

0 commit comments

Comments
 (0)
Please sign in to comment.