From cc160995daa9bb2e5a37abd0295ca0837fd671d4 Mon Sep 17 00:00:00 2001 From: fatedier Date: Mon, 11 Dec 2017 16:21:17 +0800 Subject: [PATCH] improve error role log info --- models/config/proxy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/config/proxy.go b/models/config/proxy.go index 75eb138..21e8664 100644 --- a/models/config/proxy.go +++ b/models/config/proxy.go @@ -635,7 +635,7 @@ func (cfg *StcpProxyConf) LoadFromFile(name string, section ini.Section) (err er if tmpStr == "server" || tmpStr == "visitor" { cfg.Role = tmpStr } else { - cfg.Role = "server" + return fmt.Errorf("Parse conf error: incorrect role [%s]", tmpStr) } cfg.Sk = section["sk"] @@ -724,7 +724,7 @@ func (cfg *XtcpProxyConf) LoadFromFile(name string, section ini.Section) (err er if tmpStr == "server" || tmpStr == "visitor" { cfg.Role = tmpStr } else { - cfg.Role = "server" + return fmt.Errorf("Parse conf error: incorrect role [%s]", tmpStr) } cfg.Sk = section["sk"]