Commit d593ffe3 by Leonard Gram

dashboards: better error handling

parent 89d4db8e
......@@ -281,7 +281,8 @@ func (hs *HTTPServer) PostDashboard(c *m.ReqContext, cmd m.SaveDashboardCommand)
aclService := dashboards.NewAclService()
err := aclService.MakeUserAdmin(cmd.OrgId, cmd.UserId, dashboard.Id)
if err != nil {
hs.log.Error("Could not make user admin", "error", err)
hs.log.Error("Could not make user admin", "dashboard", cmd.Result.Title, "user", c.SignedInUser.UserId, "error", err)
return Error(500, "Failed to make user admin of dashboard", err)
}
}
......
......@@ -63,7 +63,10 @@ func (hs *HTTPServer) CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) R
if hs.Cfg.EditorsCanOwn {
aclService := dashboards.NewAclService()
aclService.MakeUserAdmin(c.OrgId, c.SignedInUser.UserId, cmd.Result.Id)
if err := aclService.MakeUserAdmin(c.OrgId, c.SignedInUser.UserId, cmd.Result.Id); err != nil {
hs.log.Error("Could not make user admin", "folder", cmd.Result.Title, "user", c.SignedInUser.UserId, "error", err)
return Error(500, "Failed to make user admin of folder", err)
}
}
g := guardian.New(cmd.Result.Id, c.OrgId, c.SignedInUser)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment