diff options
author | 2016-09-10 09:16:25 +0100 | |
---|---|---|
committer | 2016-09-10 09:16:25 +0100 | |
commit | 2dd8a687b340e5ef7afa4bbe8802f25372b25cf9 (patch) | |
tree | 3be78c3e5f9f80cef1c602b2c1be0804c92e01bc /middleware/pprof/setup.go | |
parent | 5216ab6b581165ae54b5d3462e3e63d460317cf3 (diff) | |
download | coredns-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/pprof/setup.go')
-rw-r--r-- | middleware/pprof/setup.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/middleware/pprof/setup.go b/middleware/pprof/setup.go index 2b6701f35..00e192919 100644 --- a/middleware/pprof/setup.go +++ b/middleware/pprof/setup.go @@ -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 } |