mirror of
https://github.com/writeas/writefreely
synced 2025-01-21 08:25:45 +01:00
Fix generateKey error logging
This logs the actual error when it occurs, instead of always saying that the key already exists.
This commit is contained in:
parent
cb1bd37f64
commit
1c40103fbf
5
keys.go
5
keys.go
@ -73,9 +73,12 @@ func initKeys(app *app) error {
|
||||
// keys, this won't overwrite any existing key, and instead outputs a message.
|
||||
func generateKey(path string) error {
|
||||
// Check if key file exists
|
||||
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
log.Info("%s already exists. rm the file if you understand the consquences.", path)
|
||||
return nil
|
||||
} else if !os.IsNotExist(err) {
|
||||
log.Error("%s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Info("Generating %s.", path)
|
||||
|
Loading…
Reference in New Issue
Block a user