fix: process add errors wrap. (#1862)

* fix: process add errors wrap.

* fix: process add errors wrap.
This commit is contained in:
OpenIM-Gordon
2024-02-02 10:11:13 +08:00
committed by GitHub
parent 55ca661d13
commit c55e03dc70
21 changed files with 143 additions and 111 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ package mgo
import (
"context"
"github.com/OpenIMSDK/tools/errs"
"time"
"github.com/OpenIMSDK/protocol/constant"
@@ -38,7 +39,7 @@ func NewConversationMongo(db *mongo.Database) (*ConversationMgo, error) {
Options: options.Index().SetUnique(true),
})
if err != nil {
return nil, err
return nil, errs.Wrap(err)
}
return &ConversationMgo{coll: coll}, nil
}
+2 -1
View File
@@ -16,6 +16,7 @@ package mgo
import (
"context"
"github.com/OpenIMSDK/tools/errs"
"time"
"github.com/OpenIMSDK/tools/mgoutil"
@@ -36,7 +37,7 @@ func NewGroupMongo(db *mongo.Database) (relation.GroupModelInterface, error) {
Options: options.Index().SetUnique(true),
})
if err != nil {
return nil, err
return nil, errs.Wrap(err)
}
return &GroupMgo{coll: coll}, nil
}
+2 -1
View File
@@ -16,6 +16,7 @@ package mgo
import (
"context"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/tools/mgoutil"
@@ -37,7 +38,7 @@ func NewGroupMember(db *mongo.Database) (relation.GroupMemberModelInterface, err
Options: options.Index().SetUnique(true),
})
if err != nil {
return nil, err
return nil, errs.Wrap(err)
}
return &GroupMemberMgo{coll: coll}, nil
}
+2 -1
View File
@@ -16,6 +16,7 @@ package mgo
import (
"context"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/mgoutil"
"github.com/OpenIMSDK/tools/pagination"
@@ -36,7 +37,7 @@ func NewGroupRequestMgo(db *mongo.Database) (relation.GroupRequestModelInterface
Options: options.Index().SetUnique(true),
})
if err != nil {
return nil, err
return nil, errs.Wrap(err)
}
return &GroupRequestMgo{coll: coll}, nil
}
+1 -1
View File
@@ -40,7 +40,7 @@ func NewUserMongo(db *mongo.Database) (relation.UserModelInterface, error) {
Options: options.Index().SetUnique(true),
})
if err != nil {
return nil, err
return nil, errs.Wrap(err)
}
return &UserMgo{coll: coll}, nil
}