mirror of
https://github.com/gogs/gogs.git
synced 2026-01-08 16:32:17 +01:00
pkg/ssh: print actual error in panic (#5435)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user