pkg/ssh: print actual error in panic (#5435)

This commit is contained in:
Unknwon
2018-09-28 15:37:34 -04:00
parent 33e009bedb
commit aff0bbcc32
5 changed files with 36 additions and 36 deletions

View File

@@ -175,11 +175,11 @@ func Listen(host string, port int, ciphers []string) {
privateBytes, err := ioutil.ReadFile(keyPath)
if err != nil {
panic("SSH: Fail to load private key")
panic("SSH: Fail to load private key: " + err.Error())
}
private, err := ssh.ParsePrivateKey(privateBytes)
if err != nil {
panic("SSH: Fail to parse private key")
panic("SSH: Fail to parse private key: " + err.Error())
}
config.AddHostKey(private)