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
+4 -2
View File
@@ -124,7 +124,8 @@ func TestUserAuthToken(t *testing.T) {
for i := 0; i < 3; i++ {
userId := userID + int64(i+1)
userIds = append(userIds, userId)
userAuthTokenService.CreateToken(context.Background(), userId, "192.168.10.11:1234", "some user agent")
_, err := userAuthTokenService.CreateToken(context.Background(), userId, "192.168.10.11:1234", "some user agent")
So(err, ShouldBeNil)
}
err := userAuthTokenService.BatchRevokeAllUserTokens(context.Background(), userIds)
@@ -441,7 +442,8 @@ func TestUserAuthToken(t *testing.T) {
utMap := utJSON.MustMap()
var uat userAuthToken
uat.fromUserToken(&ut)
err = uat.fromUserToken(&ut)
So(err, ShouldBeNil)
uatBytes, err := json.Marshal(uat)
So(err, ShouldBeNil)
uatJSON, err := simplejson.NewJson(uatBytes)