mirror of
https://github.com/gogs/gogs.git
synced 2026-03-03 18:51:06 +01:00
pkg/ssh: print actual error in panic (#5435)
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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