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
@@ -155,6 +155,6 @@ func (m *AddMakeRegionSingleRowMigration) Exec(sess *xorm.Session, mg *Migrator)
}
}
sess.Exec("DELETE FROM annotation WHERE region_id > 0 AND id <> region_id")
return nil
_, err = sess.Exec("DELETE FROM annotation WHERE region_id > 0 AND id <> region_id")
return err
}
@@ -25,7 +25,8 @@ func TestMigrations(t *testing.T) {
x, err := xorm.NewEngine(testDB.DriverName, testDB.ConnStr)
So(err, ShouldBeNil)
NewDialect(x).CleanDB()
err = NewDialect(x).CleanDB()
So(err, ShouldBeNil)
_, err = x.SQL(sql).Get(&r)
So(err, ShouldNotBeNil)