mirror of
https://github.com/daeuniverse/dae.git
synced 2025-07-15 10:18:45 +07:00
chore: simplify some error prompt
This commit is contained in:
@ -463,8 +463,11 @@ func (d *Dialer) Check(timeout time.Duration,
|
|||||||
} else {
|
} else {
|
||||||
// Append timeout if there is any error or unexpected status code.
|
// Append timeout if there is any error or unexpected status code.
|
||||||
if err != nil {
|
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")
|
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{
|
d.Log.WithFields(logrus.Fields{
|
||||||
"network": opts.networkType.String(),
|
"network": opts.networkType.String(),
|
||||||
|
Reference in New Issue
Block a user