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

Function IsKeyParseError

utils/ssh.go:682–694  ·  view source on GitHub ↗

IsKeyParseError checks if the error is due to a corrupt or invalid private key file

(err error)

Source from the content-addressed store, hash-verified

680
681// IsKeyParseError checks if the error is due to a corrupt or invalid private key file
682func IsKeyParseError(err error) bool {
683 if err == nil {
684 return false
685 }
686 errMsg := strings.ToLower(err.Error())
687 return messageContainsAny(errMsg,
688 "failed to parse private key",
689 "no key found",
690 "ssh: no key found",
691 "asn1:",
692 "illegal base64",
693 )
694}
695
696// IsNetworkError checks if the error is a network connectivity issue
697func IsNetworkError(err error) bool {

Callers 2

runConnectWithOptionsFunction · 0.92
ClassifySSHErrorFunction · 0.85

Calls 2

messageContainsAnyFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected