summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-02-15 09:25:21 +0800
committerGitHub <noreply@github.com>2017-02-15 09:25:21 +0800
commitbe55460b63dd441f4b3879fdaafa2385927cd59c (patch)
treeab4dbd12a44061ee6148af6c16b88ec23e8d72da /cmd
parent9c645b54dcc3049a90de0c4d47c6efb0f8c1861d (diff)
downloadgitea-be55460b63dd441f4b3879fdaafa2385927cd59c.tar.gz
gitea-be55460b63dd441f4b3879fdaafa2385927cd59c.zip
catch error on call setup on serv command (#932)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/serve.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/serve.go b/cmd/serve.go
index 73b9dddd63..c69254e3f5 100644
--- a/cmd/serve.go
+++ b/cmd/serve.go
@@ -47,7 +47,7 @@ var CmdServ = cli.Command{
},
}
-func setup(logPath string) {
+func setup(logPath string) error {
setting.NewContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
@@ -60,7 +60,7 @@ func setup(logPath string) {
}
}
- models.SetEngine()
+ return models.SetEngine()
}
func parseCmd(cmd string) (string, string) {
@@ -146,7 +146,9 @@ func runServ(c *cli.Context) error {
setting.CustomConf = c.String("config")
}
- setup("serv.log")
+ if err := setup("serv.log"); err != nil {
+ fail("System init failed", fmt.Sprintf("setup: %v", err))
+ }
if setting.SSH.Disabled {
println("Gitea: SSH has been disabled")