Skip to content

Commit 19f2a69

Browse files
authored
Improve error messages (#211)
* Expand errors when dashboard failed to be parsed * Lint
1 parent a898447 commit 19f2a69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/mixer/lint.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,19 @@ func lintGrafanaDashboards(filename string, vm *jsonnet.VM, errsOut chan<- error
195195
config := lint.NewConfigurationFile()
196196
configFilename := path.Join(path.Dir(filename), ".lint")
197197
if err := config.Load(configFilename); err != nil {
198-
errsOut <- err
198+
errsOut <- fmt.Errorf("failed to load the dashboard-linter config file %s: %v", configFilename, err)
199199
continue
200200
}
201201

202202
dash, err := lint.NewDashboard(raw)
203203
if err != nil {
204-
errsOut <- err
204+
errsOut <- fmt.Errorf("failed to parse the dashboard %s: %v", dashboardFilename, err)
205205
continue
206206
}
207207

208208
rs, err := rules.Lint([]lint.Dashboard{dash})
209209
if err != nil {
210-
errsOut <- err
210+
errsOut <- fmt.Errorf("failed to lint the dashboard %s: %v", dashboardFilename, err)
211211
continue
212212
}
213213

0 commit comments

Comments
 (0)