Merge pull request #726 from shuaihanhungry/develop

do not ignore config parsing error
This commit is contained in:
fatedier 2018-05-02 21:51:02 +08:00 committed by GitHub
commit d5f30ccd6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,13 +82,17 @@ var rootCmd = &cobra.Command{
return nil
}
var err error
if cfgFile != "" {
parseServerCommonCfg(CfgFileTypeIni, cfgFile)
err = parseServerCommonCfg(CfgFileTypeIni, cfgFile)
} else {
parseServerCommonCfg(CfgFileTypeCmd, "")
err = parseServerCommonCfg(CfgFileTypeCmd, "")
}
if err != nil {
return err
}
err := runServer()
err = runServer()
if err != nil {
fmt.Println(err)
os.Exit(1)
@ -113,7 +117,7 @@ func parseServerCommonCfg(fileType int, filePath string) (err error) {
return
}
g.GlbServerCfg.CfgFile = cfgFile
g.GlbServerCfg.CfgFile = filePath
err = g.GlbServerCfg.ServerCommonConf.Check()
if err != nil {