mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-07 02:56:42 +08:00
Error code standardization
This commit is contained in:
parent
bf747e538b
commit
c77868bfae
@ -41,7 +41,7 @@ func WriteErrorResponse(ctx context.Context, funcName string, err error, args ..
|
|||||||
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": e.ErrCode, "errMsg": e.ErrMsg})
|
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": e.ErrCode, "errMsg": e.ErrMsg})
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": constant.ErrDefault.ErrCode, "errMsg": constant.ErrDefault.ErrMsg})
|
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": constant.ErrDefaultOther.ErrCode, "errMsg": constant.ErrDefaultOther.ErrMsg})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,6 +84,6 @@ func argsHandle(args []interface{}, fields map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetApiErr(errCode int32, errMsg string) api_struct.ErrInfo {
|
func GetApiErr(errCode int32, errMsg string) constant.ErrInfo {
|
||||||
return api_struct.ErrInfo{ErrCode: errCode, ErrMsg: errMsg}
|
return constant.ErrInfo{ErrCode: errCode, ErrMsg: errMsg}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user