Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode

This commit is contained in:
wangchuxiao
2023-01-12 16:13:54 +08:00
5 changed files with 28 additions and 40 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ func WriteErrorResponse(ctx context.Context, funcName string, err error, args ..
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": t.ErrCode, "errMsg": t.ErrMsg, "errDtl": t.DetailErrMsg})
return
default:
s, ok := status.FromError(err)
s, ok := status.FromError(e)
if !ok {
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": constant.ErrDefaultOther.ErrCode, "errMsg": err.Error(), "errDtl": fmt.Sprintf("%+v", err)})
return