mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-05 21:11:55 +07:00
chore: simplify some error prompt
This commit is contained in:
parent
6b68e74335
commit
b767036966
@ -463,8 +463,11 @@ func (d *Dialer) Check(timeout time.Duration,
|
||||
} else {
|
||||
// Append timeout if there is any error or unexpected status code.
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "network is unreachable") {
|
||||
if strings.HasSuffix(err.Error(), "network is unreachable") {
|
||||
err = fmt.Errorf("network is unreachable")
|
||||
} else if strings.HasSuffix(err.Error(), "no suitable address found") ||
|
||||
strings.HasSuffix(err.Error(), "non-IPv4 address") {
|
||||
err = fmt.Errorf("IPv%v is not supported", opts.networkType.IpVersion)
|
||||
}
|
||||
d.Log.WithFields(logrus.Fields{
|
||||
"network": opts.networkType.String(),
|
||||
|
Loading…
Reference in New Issue
Block a user