aboutsummaryrefslogtreecommitdiff
path: root/middleware/bind
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-09-10 09:16:25 +0100
committerGravatar GitHub <noreply@github.com> 2016-09-10 09:16:25 +0100
commit2dd8a687b340e5ef7afa4bbe8802f25372b25cf9 (patch)
tree3be78c3e5f9f80cef1c602b2c1be0804c92e01bc /middleware/bind
parent5216ab6b581165ae54b5d3462e3e63d460317cf3 (diff)
downloadcoredns-2dd8a687b340e5ef7afa4bbe8802f25372b25cf9.tar.gz
coredns-2dd8a687b340e5ef7afa4bbe8802f25372b25cf9.tar.zst
coredns-2dd8a687b340e5ef7afa4bbe8802f25372b25cf9.zip
Startup notification (#250)
Stop the caddy message and start our own init notifications. Log the version of CoreDNS when starting up. Fix all middleware's setup functions so that return the error prefixed with *which* middleware was failing; leads to better debuggable errors when starting up.
Diffstat (limited to 'middleware/bind')
-rw-r--r--middleware/bind/setup.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/middleware/bind/setup.go b/middleware/bind/setup.go
index c08098b5d..1c40e8fda 100644
--- a/middleware/bind/setup.go
+++ b/middleware/bind/setup.go
@@ -5,6 +5,7 @@ import (
"net"
"github.com/miekg/coredns/core/dnsserver"
+ "github.com/miekg/coredns/middleware"
"github.com/mholt/caddy"
)
@@ -13,11 +14,11 @@ func setupBind(c *caddy.Controller) error {
config := dnsserver.GetConfig(c)
for c.Next() {
if !c.Args(&config.ListenHost) {
- return c.ArgErr()
+ return middleware.Error("bind", c.ArgErr())
}
}
if net.ParseIP(config.ListenHost) == nil {
- return fmt.Errorf("not a valid IP address: %s", config.ListenHost)
+ return middleware.Error("bind", fmt.Errorf("not a valid IP address: %s", config.ListenHost))
}
return nil
}