mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Return useful error on wrong sshkey path (#374)
close #366 Reviewed-on: https://gitea.com/gitea/tea/pulls/374 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Norwin <noerw@noreply.gitea.io> Co-authored-by: 6543 <6543@obermui.de> Co-committed-by: 6543 <6543@obermui.de>
This commit is contained in:
		| @@ -55,7 +55,7 @@ func readSSHPrivKey(keyFile string, passwordCallback pwCallback) (sig ssh.Signer | ||||
| 	} | ||||
| 	sshKey, err := ioutil.ReadFile(keyFile) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 		return nil, fmt.Errorf("can not read ssh key '%s'", keyFile) | ||||
| 	} | ||||
| 	sig, err = ssh.ParsePrivateKey(sshKey) | ||||
| 	if _, ok := err.(*ssh.PassphraseMissingError); ok && passwordCallback != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 6543
					6543