瀏覽代碼

fix(config): error message for broken config file

closes #6731
bergquist 9 年之前
父節點
當前提交
ab2f109443
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 0
      CHANGELOG.md
  2. 2 1
      pkg/setting/setting.go

+ 1 - 0
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)
 * **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)
 * **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)
 * **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)
 # 4.0-beta2 (2016-11-21)
 
 

+ 2 - 1
pkg/setting/setting.go

@@ -325,11 +325,12 @@ func loadSpecifedConfigFile(configFile string) error {
 	}
 	}
 
 
 	userConfig, err := ini.Load(configFile)
 	userConfig, err := ini.Load(configFile)
-	userConfig.BlockMode = false
 	if err != nil {
 	if err != nil {
 		return fmt.Errorf("Failed to parse %v, %v", configFile, err)
 		return fmt.Errorf("Failed to parse %v, %v", configFile, err)
 	}
 	}
 
 
+	userConfig.BlockMode = false
+
 	for _, section := range userConfig.Sections() {
 	for _, section := range userConfig.Sections() {
 		for _, key := range section.Keys() {
 		for _, key := range section.Keys() {
 			if key.Value() == "" {
 			if key.Value() == "" {