Pull request 1784: 5631-lookup-panic

Merge in DNS/adguard-home from 5631-lookup-panic to master

Updates .

Squashed commit of the following:

commit 0ec578485bd955146d9119b6b8dafda33bfcefad
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Mar 24 20:42:26 2023 +0500

    all: imp code, log changes

commit fc43c39418640af4864ec3b5bc92ec31ec9cd018
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Fri Mar 24 20:15:27 2023 +0500

    home: handle error, upd proxy
This commit is contained in:
Eugene Burkov 2023-03-24 18:47:53 +03:00
parent d859a33787
commit fb7b8bba6a
4 changed files with 13 additions and 13 deletions
internal/home

View file

@ -896,13 +896,14 @@ func customDialContext(ctx context.Context, network, addr string) (conn net.Conn
}
addrs, err := Context.dnsServer.Resolve(host)
log.Debug("dnsServer.Resolve: %s: %v", host, addrs)
if err != nil {
return nil, err
return nil, fmt.Errorf("resolving %q: %w", host, err)
}
log.Debug("dnsServer.Resolve: %q: %v", host, addrs)
if len(addrs) == 0 {
return nil, fmt.Errorf("couldn't lookup host: %s", host)
return nil, fmt.Errorf("couldn't lookup host: %q", host)
}
var dialErrs []error