show the domain name with the error (#7886)
* show the domain name if DNSLink failed to resolve a domain because it wasn't a valid domain name Original author: @AluisioASG
@RubenKelevra committed
Jan 28, 2021 at 21:22 UTC
dd295e45608560d2ada7d7c8a30f1eef3f4019bb
1 file changed
+2
-1
namesys/dns.go
+2
-1
@@ -5,6 +5,7 @@ import (
5
"errors"
6
"net"
7
"strings"
8
+ "fmt"
9
10
path "github.com/ipfs/go-path"
11
opts "github.com/ipfs/interface-go-ipfs-core/options/namesys"
@@ -53,7 +54,7 @@ func (r *DNSResolver) resolveOnceAsync(ctx context.Context, name string, options
54
domain := segments[0]
55
56
if !isd.IsDomain(domain) {
56
- out <- onceResult{err: errors.New("not a valid domain name")}
57
+ out <- onceResult{err: fmt.Errorf("not a valid domain name: %s", domain)}
58
close(out)
59
return out
60
}