mirror of
https://github.com/go-gitea/gitea
synced 2025-07-24 11:18:36 +00:00
Catch os... errors
This commit is contained in:
committed by
Kim "BKC" Carlbäcker
parent
5ab85372da
commit
4ff0db0246
@@ -192,7 +192,10 @@ func SetEngine() (err error) {
|
||||
// WARNING: for serv command, MUST remove the output to os.stdout,
|
||||
// so use log file to instead print to stdout.
|
||||
logPath := path.Join(setting.LogRootPath, "xorm.log")
|
||||
os.MkdirAll(path.Dir(logPath), os.ModePerm)
|
||||
|
||||
if err := os.MkdirAll(path.Dir(logPath), os.ModePerm); err != nil {
|
||||
return fmt.Errorf("Fail to create dir %s: %v", logPath, err)
|
||||
}
|
||||
|
||||
f, err := os.Create(logPath)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user