IsKeyParseError checks if the error is due to a corrupt or invalid private key file
(err error)
| 680 | |
| 681 | // IsKeyParseError checks if the error is due to a corrupt or invalid private key file |
| 682 | func 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 |
| 697 | func IsNetworkError(err error) bool { |
no test coverage detected