mirror of
https://github.com/coredns/coredns.git
synced 2026-05-26 03:40:23 -04:00
lint(errorlint): handle wrapped errors
Enable errorlint and preserve wrapped error chains so runtime checks and tests classify failures correctly. This also makes Route53 surface insert failures instead of silently dropping them. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -457,7 +457,7 @@ func TestGRPCResponseTsigStatusReturnsStoredStatus(t *testing.T) {
|
||||
tsigStatus: want,
|
||||
}
|
||||
|
||||
if got := r.TsigStatus(); got != want {
|
||||
if got := r.TsigStatus(); !errors.Is(got, want) {
|
||||
t.Fatalf("TsigStatus() = %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -579,7 +580,7 @@ func TestServeHTTPAcceptsValidTSIG(t *testing.T) {
|
||||
|
||||
func TestDoHWriterTsigStatusReturnsStoredStatus(t *testing.T) {
|
||||
dw := &DoHWriter{tsigStatus: dns.ErrSecret}
|
||||
if dw.TsigStatus() != dns.ErrSecret {
|
||||
if !errors.Is(dw.TsigStatus(), dns.ErrSecret) {
|
||||
t.Fatal("expected TsigStatus to return stored tsigStatus")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ func (s *ServerQUIC) serveQUICStream(stream *quic.Stream, conn *quic.Conn) {
|
||||
// io.EOF does not really mean that there's any error, it is just
|
||||
// the STREAM FIN indicating that there will be no data to read
|
||||
// anymore from this stream.
|
||||
if err != nil && err != io.EOF {
|
||||
if err != nil && !errors.Is(err, io.EOF) {
|
||||
s.closeQUICConn(conn, DoQCodeProtocolError)
|
||||
|
||||
return
|
||||
|
||||
@@ -455,7 +455,7 @@ func TestDoQWriterTsigStatusReturnsStoredStatus(t *testing.T) {
|
||||
tsigStatus: want,
|
||||
}
|
||||
|
||||
if got := w.TsigStatus(); got != want {
|
||||
if got := w.TsigStatus(); !errors.Is(got, want) {
|
||||
t.Fatalf("TsigStatus() = %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user