diff options
author | Bwko <bouwko@gmail.com> | 2016-12-01 00:56:15 +0100 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2016-12-02 07:41:19 +0100 |
commit | 4ff0db0246fa8a2add1032220024975203b93d72 (patch) | |
tree | 6395dd608ba47cc6429bc12d9595f09ebb915f02 /models/models.go | |
parent | 5ab85372da74bd95f7143fd59c2c600d4c9894d0 (diff) | |
download | gitea-4ff0db0246fa8a2add1032220024975203b93d72.tar.gz gitea-4ff0db0246fa8a2add1032220024975203b93d72.zip |
Catch os... errors
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/models/models.go b/models/models.go index bab04c661b..56306d61f5 100644 --- a/models/models.go +++ b/models/models.go @@ -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 { |