(err error)
| 378 | } |
| 379 | |
| 380 | func shouldRetryDial(err error) bool { |
| 381 | if err == nil { |
| 382 | return false |
| 383 | } |
| 384 | if netErr, ok := err.(net.Error); ok { |
| 385 | if netErr.Timeout() { |
| 386 | return true |
| 387 | } |
| 388 | } |
| 389 | msg := strings.ToLower(err.Error()) |
| 390 | return messageContainsAny(msg, |
| 391 | "connection refused", |
| 392 | "no route to host", |
| 393 | "operation timed out", |
| 394 | "i/o timeout", |
| 395 | "connection reset", |
| 396 | "broken pipe", |
| 397 | "network is unreachable", |
| 398 | ) |
| 399 | } |
| 400 | |
| 401 | func shouldRetrySSH(err error) bool { |
| 402 | if err == nil { |