From c4ab98c6e336a1c39b3934bbb3bf691f849a6dbe Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 20 Dec 2016 18:58:05 +0000 Subject: 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. --- middleware/pkg/debug/debug.go | 1 + 1 file changed, 1 insertion(+) (limited to 'middleware/pkg/debug/debug.go') 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. -- cgit v1.2.3