diff options
author | enahum <nahumhbl@gmail.com> | 2016-06-20 12:14:02 -0300 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-06-20 09:14:02 -0600 |
commit | 1ac3bfa603ef0a5822d7e775c085c3f02fdde359 (patch) | |
tree | e07434e00f37a89061dbbd27e9d8b9916866c704 | |
parent | 8c8344fc41f680ff959db4b9b061e5cd9e7848bd (diff) | |
download | chat-1ac3bfa603ef0a5822d7e775c085c3f02fdde359.tar.gz chat-1ac3bfa603ef0a5822d7e775c085c3f02fdde359.tar.bz2 chat-1ac3bfa603ef0a5822d7e775c085c3f02fdde359.zip |
PLT-3364 Fix panic when load config failes (#3361)
-rw-r--r-- | i18n/de.json | 4 | ||||
-rw-r--r-- | i18n/en.json | 4 | ||||
-rw-r--r-- | i18n/es.json | 4 | ||||
-rw-r--r-- | i18n/fr.json | 4 | ||||
-rw-r--r-- | i18n/ja.json | 4 | ||||
-rw-r--r-- | i18n/pt-BR.json | 4 | ||||
-rw-r--r-- | mattermost.go | 5 | ||||
-rw-r--r-- | utils/config.go | 1 |
8 files changed, 3 insertions, 27 deletions
diff --git a/i18n/de.json b/i18n/de.json index f1ecd1464..4451c810e 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -2252,10 +2252,6 @@ "translation": "Fehler beim Laden der Systemadministratoren für Sicherheitsupdates von Mattermost." }, { - "id": "mattermost.unable_to_load_config", - "translation": "Laden der Mattermost Konfigurationsdatei nicht möglich:" - }, - { "id": "mattermost.working_dir", "translation": "Aktuelles Arbeitsverzeichnis ist %v" }, diff --git a/i18n/en.json b/i18n/en.json index 26ba3141c..17e3d9599 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2256,10 +2256,6 @@ "translation": "Failed to get system admins for security update information from Mattermost." }, { - "id": "mattermost.unable_to_load_config", - "translation": "Unable to load mattermost configuration file:" - }, - { "id": "mattermost.working_dir", "translation": "Current working directory is %v" }, diff --git a/i18n/es.json b/i18n/es.json index 247119839..a1d5d5880 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -2252,10 +2252,6 @@ "translation": "Falla al obtener los administradores de sistema que reciben información referente a las actualizaciones de seguridade de Mattermost." }, { - "id": "mattermost.unable_to_load_config", - "translation": "No se pudo cargar el archivo de configuración de Mattermost:" - }, - { "id": "mattermost.working_dir", "translation": "El directorio de trabajo actual es %v" }, diff --git a/i18n/fr.json b/i18n/fr.json index a4f71c8bd..0fd0903f9 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -2252,10 +2252,6 @@ "translation": "Échec du chargement de la liste des administrateurs système pour les informer d'une mise à jour de sécurité de Mattermost." }, { - "id": "mattermost.unable_to_load_config", - "translation": "Impossible de charger le fichier de configuration mattermost :" - }, - { "id": "mattermost.working_dir", "translation": "Le dossier de travail actuel est %v" }, diff --git a/i18n/ja.json b/i18n/ja.json index 31f54a879..090c2cf93 100644 --- a/i18n/ja.json +++ b/i18n/ja.json @@ -2252,10 +2252,6 @@ "translation": "Mattermostからのセキュリティーアップデート情報に関してシステム管理者を取得できません" }, { - "id": "mattermost.unable_to_load_config", - "translation": "Mattermostの設定ファイルを読み込めません:" - }, - { "id": "mattermost.working_dir", "translation": "現在のワーキングディレクトリーは%vです" }, diff --git a/i18n/pt-BR.json b/i18n/pt-BR.json index fc96fe55f..bcd7fdef4 100644 --- a/i18n/pt-BR.json +++ b/i18n/pt-BR.json @@ -2252,10 +2252,6 @@ "translation": "Falha ao obter administradores do sistema para a informação de atualização de segurança do Mattermost." }, { - "id": "mattermost.unable_to_load_config", - "translation": "Não foi possível carregar o arquivo de configuração do mattermost:" - }, - { "id": "mattermost.working_dir", "translation": "Diretório atual é %v" }, 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) diff --git a/utils/config.go b/utils/config.go index f3b62a25a..5b8ba0906 100644 --- a/utils/config.go +++ b/utils/config.go @@ -178,7 +178,6 @@ func LoadConfig(fileName string) { } configureLog(&config.LogSettings) - TestConnection(&config) if config.FileSettings.DriverName == model.IMAGE_DRIVER_LOCAL { dir := config.FileSettings.Directory |