aboutsummaryrefslogtreecommitdiff
path: root/middleware/pkg/debug/debug.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-12-20 18:58:05 +0000
committerGravatar GitHub <noreply@github.com> 2016-12-20 18:58:05 +0000
commitc4ab98c6e336a1c39b3934bbb3bf691f849a6dbe (patch)
tree89d801ac1484232179bcb7c144f67b5945221367 /middleware/pkg/debug/debug.go
parent451a0bd5294f6c8a6c9c725c75ac1a9cbc996a42 (diff)
downloadcoredns-c4ab98c6e336a1c39b3934bbb3bf691f849a6dbe.tar.gz
coredns-c4ab98c6e336a1c39b3934bbb3bf691f849a6dbe.tar.zst
coredns-c4ab98c6e336a1c39b3934bbb3bf691f849a6dbe.zip
Add middleware.NextOrFailure (#462)
This checks if the next middleware to be called is nil, and if so returns ServerFailure and an error. This makes the next calling more robust and saves some lines of code. Also prefix the error with the name of the middleware to aid in debugging.
Diffstat (limited to 'middleware/pkg/debug/debug.go')
-rw-r--r--middleware/pkg/debug/debug.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/middleware/pkg/debug/debug.go b/middleware/pkg/debug/debug.go
index b3c33b344..186872f12 100644
--- a/middleware/pkg/debug/debug.go
+++ b/middleware/pkg/debug/debug.go
@@ -2,6 +2,7 @@ package debug
import "strings"
+// Name is the domain prefix we check for when it is a debug query.
const Name = "o-o.debug."
// IsDebug checks if name is a debugging name, i.e. starts with o-o.debug.