pkg/services: Check errors (#19712)

* pkg/services: Check errors
* pkg/services: Don't treat context.Canceled|context.DeadlineExceeded as error
This commit is contained in:
Arve Knudsen
2019-10-22 14:08:18 +02:00
committed by GitHub
parent de5038441f
commit 2a78d2a61c
37 changed files with 431 additions and 191 deletions
+6 -3
View File
@@ -345,15 +345,17 @@ func TestDashboardDataAccess(t *testing.T) {
Convey("Given two dashboards, one is starred dashboard by user 10, other starred by user 1", func() {
starredDash := insertTestDashboard("starred dash", 1, 0, false)
StarDashboard(&m.StarDashboardCommand{
err := StarDashboard(&m.StarDashboardCommand{
DashboardId: starredDash.Id,
UserId: 10,
})
So(err, ShouldBeNil)
StarDashboard(&m.StarDashboardCommand{
err = StarDashboard(&m.StarDashboardCommand{
DashboardId: savedDash.Id,
UserId: 1,
})
So(err, ShouldBeNil)
Convey("Should be able to search for starred dashboards", func() {
query := search.FindPersistedDashboardsQuery{
@@ -439,7 +441,8 @@ func createUser(name string, role string, isAdmin bool) m.User {
So(err, ShouldBeNil)
q1 := m.GetUserOrgListQuery{UserId: currentUserCmd.Result.Id}
GetUserOrgList(&q1)
err = GetUserOrgList(&q1)
So(err, ShouldBeNil)
So(q1.Result[0].Role, ShouldEqual, role)
return currentUserCmd.Result