Commit 0d856cc1 by Torkel Ödegaard

Error message for missing dashboards.json config section, Closes #2256

parent a38a06a0
package search package search
import ( import (
"log"
"path/filepath" "path/filepath"
"sort" "sort"
...@@ -15,6 +16,12 @@ func Init() { ...@@ -15,6 +16,12 @@ func Init() {
bus.AddHandler("search", searchHandler) bus.AddHandler("search", searchHandler)
jsonIndexCfg, _ := setting.Cfg.GetSection("dashboards.json") jsonIndexCfg, _ := setting.Cfg.GetSection("dashboards.json")
if jsonIndexCfg == nil {
log.Fatal("Config section missing: dashboards.json")
return
}
jsonIndexEnabled := jsonIndexCfg.Key("enabled").MustBool(false) jsonIndexEnabled := jsonIndexCfg.Key("enabled").MustBool(false)
if jsonIndexEnabled { if jsonIndexEnabled {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment