From dd295e45608560d2ada7d7c8a30f1eef3f4019bb Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Thu, 28 Jan 2021 21:22:36 +0100 Subject: [PATCH] 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 --- namesys/dns.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/namesys/dns.go b/namesys/dns.go index 984a27aa8..0b48ad34b 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -5,6 +5,7 @@ import ( "errors" "net" "strings" + "fmt" path "github.com/ipfs/go-path" opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" @@ -53,7 +54,7 @@ func (r *DNSResolver) resolveOnceAsync(ctx context.Context, name string, options domain := segments[0] if !isd.IsDomain(domain) { - out <- onceResult{err: errors.New("not a valid domain name")} + out <- onceResult{err: fmt.Errorf("not a valid domain name: %s", domain)} close(out) return out }