fix: better error check
This commit is contained in:
parent
f26bc212e1
commit
60b6d68339
1 changed files with 1 additions and 2 deletions
|
@ -12,7 +12,6 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -141,7 +140,7 @@ func (doh *dnsOverHTTPS) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.
|
||||||
msg, err = doh.exchangeHTTPS(ctx, client, m)
|
msg, err = doh.exchangeHTTPS(ctx, client, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil && !strings.Contains(err.Error(), "context canceled") {
|
if err != nil && !errors.Is(err, context.Canceled) {
|
||||||
// If the request failed anyway, make sure we don't use this client.
|
// If the request failed anyway, make sure we don't use this client.
|
||||||
_, resErr := doh.resetClient(ctx, err)
|
_, resErr := doh.resetClient(ctx, err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue