From ab2f109443c0fa4e78533ce8c57451d8eb21f62e Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 28 Nov 2016 17:55:18 +0100 Subject: [PATCH] fix(config): error message for broken config file closes #6731 --- CHANGELOG.md | 1 + pkg/setting/setting.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4364d770fa..bbc3c68cb12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * **TLS Client Auth**: Support for TLS client authentication for datasource proxies [#2316](https://github.com/grafana/grafana/issues/2316) * **Alerts out of sync**: Saving dashboards with broken alerts causes sync problem[#6576](https://github.com/grafana/grafana/issues/6576) * **Alerting**: Saving an alert with condition "HAS NO DATA" throws an error[#6701](https://github.com/grafana/grafana/issues/6701) +* **Config**: Improve error message when parsing broken config file [#6731](https://github.com/grafana/grafana/issues/6731) # 4.0-beta2 (2016-11-21) diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index e56881f15f8..061068e9df1 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -325,11 +325,12 @@ func loadSpecifedConfigFile(configFile string) error { } userConfig, err := ini.Load(configFile) - userConfig.BlockMode = false if err != nil { return fmt.Errorf("Failed to parse %v, %v", configFile, err) } + userConfig.BlockMode = false + for _, section := range userConfig.Sections() { for _, key := range section.Keys() { if key.Value() == "" {