Error code standardization

test-errcode
skiffer-git 2 years ago
parent efd5da9e87
commit 84df63e249

@ -2,6 +2,7 @@ package common
import (
"Open_IM/internal/fault_tolerant"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/trace_log"
"context"
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)
errCode := errCodeVal.Interface().(int32)
if errCode != 0 {
trace_log.WriteErrorResponse(nCtx, "RpcErrCode", &api_struct.ErrInfo{
trace_log.WriteErrorResponse(nCtx, "RpcErrCode", &constant.ErrInfo{
ErrCode: errCode,
ErrMsg: errMsgVal,
})

Loading…
Cancel
Save