MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / IsNetworkError

Function IsNetworkError

utils/ssh.go:697–714  ·  view source on GitHub ↗

IsNetworkError checks if the error is a network connectivity issue

(err error)

Source from the content-addressed store, hash-verified

695
696// IsNetworkError checks if the error is a network connectivity issue
697func IsNetworkError(err error) bool {
698 if err == nil {
699 return false
700 }
701 if netErr, ok := err.(net.Error); ok {
702 if netErr.Timeout() {
703 return true
704 }
705 }
706 msg := strings.ToLower(err.Error())
707 return messageContainsAny(msg,
708 "connection refused",
709 "no route to host",
710 "operation timed out",
711 "i/o timeout",
712 "network is unreachable",
713 )
714}
715
716// ClassifySSHError determines the type of SSH error for reporting
717func ClassifySSHError(err error) SSHRetryStatus {

Callers 1

ClassifySSHErrorFunction · 0.85

Calls 3

messageContainsAnyFunction · 0.85
TimeoutMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected