Skip to content

Commit

Permalink
catch error on call setup on serv command (go-gitea#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Feb 15, 2017
1 parent 9c645b5 commit be55460
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -60,7 +60,7 @@ func setup(logPath string) {
}
}

models.SetEngine()
return models.SetEngine()
}

func parseCmd(cmd string) (string, string) {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit be55460

Please sign in to comment.