From 1ac3bfa603ef0a5822d7e775c085c3f02fdde359 Mon Sep 17 00:00:00 2001 From: enahum Date: Mon, 20 Jun 2016 12:14:02 -0300 Subject: PLT-3364 Fix panic when load config failes (#3361) --- mattermost.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mattermost.go') diff --git a/mattermost.go b/mattermost.go index 67428275a..963978ecf 100644 --- a/mattermost.go +++ b/mattermost.go @@ -71,7 +71,7 @@ var flagRunCmds bool func doLoadConfig(filename string) (err string) { defer func() { if r := recover(); r != nil { - err = r.(string) + err = fmt.Sprintf("Error loding config, err=%v", r) } }() utils.LoadConfig(filename) @@ -83,7 +83,7 @@ func main() { parseCmds() if errstr := doLoadConfig(flagConfigFile); errstr != "" { - l4g.Exit(utils.T("mattermost.unable_to_load_config"), errstr) + l4g.Exit("Unable to load mattermost configuration file:", errstr) return } @@ -91,6 +91,7 @@ func main() { utils.ConfigureCmdLineLog() } utils.InitTranslations(utils.Cfg.LocalizationSettings) + utils.TestConnection(utils.Cfg) pwd, _ := os.Getwd() l4g.Info(utils.T("mattermost.current_version"), model.CurrentVersion, model.BuildNumber, model.BuildDate, model.BuildHash, model.BuildHashEnterprise) -- cgit v1.2.3-1-g7c22