mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 16:54:15 -04:00
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.
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
"github.com/miekg/coredns/middleware"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -17,13 +18,13 @@ func setup(c *caddy.Controller) error {
|
||||
found := false
|
||||
for c.Next() {
|
||||
if found {
|
||||
return c.Err("pprof can only be specified once")
|
||||
return middleware.Error("pprof", c.Err("pprof can only be specified once"))
|
||||
}
|
||||
if len(c.RemainingArgs()) != 0 {
|
||||
return c.ArgErr()
|
||||
return middleware.Error("pprof", c.ArgErr())
|
||||
}
|
||||
if c.NextBlock() {
|
||||
return c.ArgErr()
|
||||
return middleware.Error("pprof", c.ArgErr())
|
||||
}
|
||||
found = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user