From 84df63e249bb19e6c5dded818c938ca50c270e95 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 3 Jan 2023 16:42:48 +0800 Subject: [PATCH] Error code standardization --- internal/api_to_rpc/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api_to_rpc/api.go b/internal/api_to_rpc/api.go index 65fc5cc6f..a8d1aa97a 100644 --- a/internal/api_to_rpc/api.go +++ b/internal/api_to_rpc/api.go @@ -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, })