From 270660eaa804757c99d80d962f7b2b3ea37a8155 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 29 Mar 2021 15:46:36 +0100 Subject: [PATCH] API: Return 409 on datasource version conflict (#32425) (#32433) Signed-off-by: bergquist Co-authored-by: Will Browne (cherry picked from commit 5ec530f3fcb126bc0c80a66c950575c66e1277c6) Co-authored-by: Carl Bergquist --- pkg/api/datasources.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/datasources.go b/pkg/api/datasources.go index 621e8c29943..93f08f2287d 100644 --- a/pkg/api/datasources.go +++ b/pkg/api/datasources.go @@ -241,7 +241,7 @@ func UpdateDataSource(c *models.ReqContext, cmd models.UpdateDataSourceCommand) err = bus.Dispatch(&cmd) if err != nil { if errors.Is(err, models.ErrDataSourceUpdatingOldVersion) { - return response.Error(500, "Failed to update datasource. Reload new version and try again", err) + return response.Error(409, "Datasource has already been updated by someone else. Please reload and try again", err) } return response.Error(500, "Failed to update datasource", err) }