From 0d856cc135e089110e2606af6f8e9f1735617557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 30 Jun 2015 08:05:05 +0200 Subject: [PATCH] Error message for missing dashboards.json config section, Closes #2256 --- pkg/services/search/handlers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/services/search/handlers.go b/pkg/services/search/handlers.go index 326924f05f4..1c480992cbc 100644 --- a/pkg/services/search/handlers.go +++ b/pkg/services/search/handlers.go @@ -1,6 +1,7 @@ package search import ( + "log" "path/filepath" "sort" @@ -15,6 +16,12 @@ func Init() { bus.AddHandler("search", searchHandler) jsonIndexCfg, _ := setting.Cfg.GetSection("dashboards.json") + + if jsonIndexCfg == nil { + log.Fatal("Config section missing: dashboards.json") + return + } + jsonIndexEnabled := jsonIndexCfg.Key("enabled").MustBool(false) if jsonIndexEnabled {