mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-01 07:35:58 +08:00
errCode
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package constant
|
||||
|
||||
import (
|
||||
sdkws "Open_IM/pkg/proto/sdk_ws"
|
||||
"errors"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -76,6 +77,17 @@ func ToAPIErrWithErr(err error) ErrInfo {
|
||||
return ErrDefaultOther
|
||||
}
|
||||
|
||||
func Error2CommResp(info ErrInfo, detailErr error) *sdkws.CommonResp {
|
||||
err := &sdkws.CommonResp{
|
||||
ErrCode: info.ErrCode,
|
||||
ErrMsg: info.ErrMsg,
|
||||
}
|
||||
if detailErr != nil {
|
||||
err.DetailErrMsg = detailErr.Error()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
const (
|
||||
FormattingError = 10001
|
||||
HasRegistered = 10002
|
||||
|
||||
Reference in New Issue
Block a user