Unverified Commit dd295e45 authored by @RubenKelevra's avatar @RubenKelevra Committed by GitHub

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
parent 6f6f0454
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment