From 1a041a2250d6dedbcce3bcd391bb797159c1e98e Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 14 Feb 2018 13:32:52 +0100 Subject: [PATCH] bug: return correct err message if the sql query failed has is false and the method will return m.ErrDataSourceNotFound which is incorrect. We now return the correct error message from the query ref #10843 --- pkg/services/sqlstore/datasource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/services/sqlstore/datasource.go b/pkg/services/sqlstore/datasource.go index e9b400a1772..00d520bcfc6 100644 --- a/pkg/services/sqlstore/datasource.go +++ b/pkg/services/sqlstore/datasource.go @@ -27,6 +27,9 @@ func GetDataSourceById(query *m.GetDataSourceByIdQuery) error { datasource := m.DataSource{OrgId: query.OrgId, Id: query.Id} has, err := x.Get(&datasource) + if err != nil { + return err + } if !has { return m.ErrDataSourceNotFound