mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-26 08:15:43 +08:00
Error code standardization
This commit is contained in:
parent
efd5da9e87
commit
84df63e249
@ -2,6 +2,7 @@ package common
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/internal/fault_tolerant"
|
"Open_IM/internal/fault_tolerant"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/trace_log"
|
"Open_IM/pkg/common/trace_log"
|
||||||
"context"
|
"context"
|
||||||
utils "github.com/OpenIMSDK/open_utils"
|
utils "github.com/OpenIMSDK/open_utils"
|
||||||
@ -71,7 +72,7 @@ func ApiToRpc(c *gin.Context, apiReq, apiResp interface{}, rpcName string, fn in
|
|||||||
errMsgVal := commonResp.FieldByName("ErrMsg").Interface().(string)
|
errMsgVal := commonResp.FieldByName("ErrMsg").Interface().(string)
|
||||||
errCode := errCodeVal.Interface().(int32)
|
errCode := errCodeVal.Interface().(int32)
|
||||||
if errCode != 0 {
|
if errCode != 0 {
|
||||||
trace_log.WriteErrorResponse(nCtx, "RpcErrCode", &api_struct.ErrInfo{
|
trace_log.WriteErrorResponse(nCtx, "RpcErrCode", &constant.ErrInfo{
|
||||||
ErrCode: errCode,
|
ErrCode: errCode,
|
||||||
ErrMsg: errMsgVal,
|
ErrMsg: errMsgVal,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user