This commit is contained in:
wangchuxiao 2023-03-17 12:36:26 +08:00
parent 1921e5b030
commit befd5c8636

View File

@ -74,7 +74,8 @@ func (f *friendDatabase) AddFriendRequest(ctx context.Context, fromUserID, toUse
return f.tx.Transaction(func(tx any) error {
_, err := f.friendRequest.NewTx(tx).Take(ctx, fromUserID, toUserID)
//有db错误
if err != nil && errors.Unwrap(err) != gorm.ErrRecordNotFound {
if err != nil && errs.Unwrap(err) != gorm.ErrRecordNotFound {
// errors.Unwrap()
log.ZDebug(ctx, "AddFriendRequest err", "bool", errors.Unwrap(err) != gorm.ErrRecordNotFound, "err", err.Error(), "unwrap", errors.Unwrap(err).Error())
return err
}