mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
do not ignore config parsing error
This commit is contained in:
parent
69919e8ef9
commit
b87df569e7
@ -82,13 +82,17 @@ var rootCmd = &cobra.Command{
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var err error
|
||||||
if cfgFile != "" {
|
if cfgFile != "" {
|
||||||
parseServerCommonCfg(CfgFileTypeIni, cfgFile)
|
err = parseServerCommonCfg(CfgFileTypeIni, cfgFile)
|
||||||
} else {
|
} else {
|
||||||
parseServerCommonCfg(CfgFileTypeCmd, "")
|
err = parseServerCommonCfg(CfgFileTypeCmd, "")
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err := runServer()
|
err = runServer()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@ -113,7 +117,7 @@ func parseServerCommonCfg(fileType int, filePath string) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
g.GlbServerCfg.CfgFile = cfgFile
|
g.GlbServerCfg.CfgFile = filePath
|
||||||
|
|
||||||
err = g.GlbServerCfg.ServerCommonConf.Check()
|
err = g.GlbServerCfg.ServerCommonConf.Check()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user