mirror of
https://github.com/coredns/coredns.git
synced 2025-11-05 19:46:22 -05:00
middleware/file: notify better error reporting
Slightly better errors reporting for failing to sent a notify.
This commit is contained in:
@@ -56,10 +56,12 @@ func notify(zone string, to []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func notifyAddr(c *dns.Client, m *dns.Msg, s string) error {
|
func notifyAddr(c *dns.Client, m *dns.Msg, s string) (err error) {
|
||||||
code := dns.RcodeSuccess
|
ret := new(dns.Msg)
|
||||||
|
|
||||||
|
code := dns.RcodeServerFailure
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
ret, _, err := c.Exchange(m, s)
|
ret, _, err = c.Exchange(m, s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -68,5 +70,8 @@ func notifyAddr(c *dns.Client, m *dns.Msg, s string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return fmt.Errorf("Notify for zone %q was not accepted by %q: rcode was %q", m.Question[0].Name, s, rcode.ToString(code))
|
return fmt.Errorf("Notify for zone %q was not accepted by %q: rcode was %q", m.Question[0].Name, s, rcode.ToString(code))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user