Skip to content

Commit be55460

Browse files
authored
catch error on call setup on serv command (#932)
1 parent 9c645b5 commit be55460

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/serve.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var CmdServ = cli.Command{
4747
},
4848
}
4949

50-
func setup(logPath string) {
50+
func setup(logPath string) error {
5151
setting.NewContext()
5252
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
5353

@@ -60,7 +60,7 @@ func setup(logPath string) {
6060
}
6161
}
6262

63-
models.SetEngine()
63+
return models.SetEngine()
6464
}
6565

6666
func parseCmd(cmd string) (string, string) {
@@ -146,7 +146,9 @@ func runServ(c *cli.Context) error {
146146
setting.CustomConf = c.String("config")
147147
}
148148

149-
setup("serv.log")
149+
if err := setup("serv.log"); err != nil {
150+
fail("System init failed", fmt.Sprintf("setup: %v", err))
151+
}
150152

151153
if setting.SSH.Disabled {
152154
println("Gitea: SSH has been disabled")

0 commit comments

Comments
 (0)