mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44: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:
@@ -410,7 +410,7 @@ func BackendError(b ServiceBackend, zone string, rcode int, state request.Reques
|
||||
state.SizeAndDo(m)
|
||||
state.W.WriteMsg(m)
|
||||
// Return success as the rcode to signal we have written to the client.
|
||||
return dns.RcodeSuccess, nil
|
||||
return dns.RcodeSuccess, err
|
||||
}
|
||||
|
||||
// ServicesToTxt puts debug in TXT RRs.
|
||||
|
||||
Reference in New Issue
Block a user