mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 09:14:17 -04:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user