diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-01-09 22:36:23 +0800 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-01-09 22:36:23 +0800 |
commit | f91b8c5f53dce072ed9fe72dbf4ab10cbeaa8008 (patch) | |
tree | b7575fc2108117e15e6004b60bc5765fb52d6b33 /modules/setting | |
parent | 97170916a3268c359476c00865c0369c9dc095bb (diff) | |
download | gitea-f91b8c5f53dce072ed9fe72dbf4ab10cbeaa8008.tar.gz gitea-f91b8c5f53dce072ed9fe72dbf4ab10cbeaa8008.zip |
refactor: check the error returned by os.MkdirAll()
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 7fd4cfc2fa..275e4b58a1 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -660,7 +660,9 @@ please consider changing to GITEA_CUSTOM`) cfg.Section("server").Key("LFS_JWT_SECRET").SetValue(LFS.JWTSecretBase64) - os.MkdirAll(filepath.Dir(CustomConf), os.ModePerm) + if err := os.MkdirAll(filepath.Dir(CustomConf), os.ModePerm); err != nil { + log.Fatal(4, "Fail to create '%s': %v", CustomConf, err) + } if err := cfg.SaveTo(CustomConf); err != nil { log.Fatal(4, "Error saving generated JWT Secret to custom config: %v", err) return |