fix: wrap the error of group user and thrid (#2005)

* fix: wrap the error of group user and thrid

* fix: del the chinese comment

* fix: fix the make_lint error

* fix: fix the ApiTest error
This commit is contained in:
Brabem
2024-03-06 16:20:07 +08:00
committed by GitHub
parent c7dad1a5c1
commit 52b8efba73
13 changed files with 49 additions and 50 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ func getCache[T any](ctx context.Context, rcClient *rockscache.Client, key strin
v, err := rcClient.Fetch2(ctx, key, expire, func() (s string, err error) {
t, err = fn(ctx)
if err != nil {
return "", errs.Wrap(err)
return "", err
}
bs, err := json.Marshal(t)
if err != nil {
@@ -204,7 +204,7 @@ func batchGetCache2[T any, K comparable](
fns func(ctx context.Context, key K) (T, error),
) ([]T, error) {
if len(keys) == 0 {
return nil, errs.ErrArgs.Wrap("groupID is empty")
return nil, nil
}
res := make([]T, 0, len(keys))
for _, key := range keys {
+1 -1
View File
@@ -471,7 +471,7 @@ func (c *msgCache) ParallelSetMessageToCache(ctx context.Context, conversationID
err := wg.Wait()
if err != nil {
return 0, err
return 0, errs.Wrap(err, "wg.Wait failed")
}
return len(msgs), nil