From d68bfaa8be13d639f10b01bc8e9c89a7d77606e0 Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 25 Oct 2017 11:29:19 +0200 Subject: [PATCH] datasource as cfg: typo --- pkg/api/datasources.go | 2 +- pkg/models/datasource.go | 7 +++---- pkg/services/sqlstore/datasource.go | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/api/datasources.go b/pkg/api/datasources.go index 7c509499981..747ef8f25e6 100644 --- a/pkg/api/datasources.go +++ b/pkg/api/datasources.go @@ -139,7 +139,7 @@ func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) Resp err = bus.Dispatch(&cmd) if err != nil { - if err == m.ErrDataSouceUpdatingOldVersion { + if err == m.ErrDataSourceUpdatingOldVersion { return ApiError(500, "Failed to update datasource. Reload new version and try again", err) } else { return ApiError(500, "Failed to update datasource", err) diff --git a/pkg/models/datasource.go b/pkg/models/datasource.go index f600da75a63..7fc8f935124 100644 --- a/pkg/models/datasource.go +++ b/pkg/models/datasource.go @@ -23,11 +23,10 @@ const ( DS_ACCESS_PROXY = "proxy" ) -// Typed errors var ( - ErrDataSourceNotFound = errors.New("Data source not found") - ErrDataSourceNameExists = errors.New("Data source with same name already exists") - ErrDataSouceUpdatingOldVersion = errors.New("Trying to update old version of datasouce") + ErrDataSourceNotFound = errors.New("Data source not found") + ErrDataSourceNameExists = errors.New("Data source with same name already exists") + ErrDataSourceUpdatingOldVersion = errors.New("Trying to update old version of datasource") ) type DsAccess string diff --git a/pkg/services/sqlstore/datasource.go b/pkg/services/sqlstore/datasource.go index b4974aa1fdf..7069990c476 100644 --- a/pkg/services/sqlstore/datasource.go +++ b/pkg/services/sqlstore/datasource.go @@ -167,7 +167,7 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error { } if affected == 0 { - return m.ErrDataSouceUpdatingOldVersion + return m.ErrDataSourceUpdatingOldVersion } err = updateIsDefaultFlag(ds, sess)