This commit is contained in:
withchao
2023-01-12 16:04:12 +08:00
parent 7b10b17056
commit 69e94c25f4
3 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -65,7 +65,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