mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
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
This commit is contained in:
parent
6f6f04543b
commit
dd295e4560
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user