aboutsummaryrefslogtreecommitdiff
path: root/plugin/errors/errors_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-05-10 03:04:46 +0100
committerGravatar Yong Tang <yong.tang.github@outlook.com> 2018-05-09 19:04:46 -0700
commit874a9986971e0efe27eaec92c523d563dfa8d1f7 (patch)
tree73fe049679c23e35218a2b8a35c3cfce76e5ac4f /plugin/errors/errors_test.go
parent5e7c39911740025d020964922c2a5dc1df36a723 (diff)
downloadcoredns-874a9986971e0efe27eaec92c523d563dfa8d1f7.tar.gz
coredns-874a9986971e0efe27eaec92c523d563dfa8d1f7.tar.zst
coredns-874a9986971e0efe27eaec92c523d563dfa8d1f7.zip
plugin/errors: remove panic/recover (#1777)
Remove panic/recover and also use pkg/log to print the error. This brings some consistency into the logging. Fixes #1776
Diffstat (limited to 'plugin/errors/errors_test.go')
-rw-r--r--plugin/errors/errors_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/errors/errors_test.go b/plugin/errors/errors_test.go
index f3857df56..afe809c71 100644
--- a/plugin/errors/errors_test.go
+++ b/plugin/errors/errors_test.go
@@ -18,7 +18,8 @@ import (
func TestErrors(t *testing.T) {
buf := bytes.Buffer{}
- em := errorHandler{Log: log.New(&buf, "", 0)}
+ log.SetOutput(&buf)
+ em := errorHandler{}
testErr := errors.New("test error")
tests := []struct {
@@ -36,7 +37,7 @@ func TestErrors(t *testing.T) {
{
next: genErrorHandler(dns.RcodeNotAuth, testErr),
expectedCode: dns.RcodeNotAuth,
- expectedLog: fmt.Sprintf("[ERROR %d %s] %v\n", dns.RcodeNotAuth, "example.org. A", testErr),
+ expectedLog: fmt.Sprintf("[ERROR] %d %s: %v\n", dns.RcodeNotAuth, "example.org. A", testErr),
expectedErr: testErr,
},
}