优化一个问题
This commit is contained in:
+2
-1
@@ -10,6 +10,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/yuninks/langx"
|
||||
"github.com/yuninks/errorx"
|
||||
"github.com/zeromicro/go-zero/core/trace"
|
||||
)
|
||||
|
||||
@@ -68,7 +69,7 @@ func Error(ctx context.Context, w http.ResponseWriter, err error) {
|
||||
code := op.defaultErrorCode
|
||||
msg := "请求失败"
|
||||
if err != nil {
|
||||
val, ok := err.(langx.LangError)
|
||||
val, ok := err.(errorx.ErrorInterface)
|
||||
if ok {
|
||||
if langx.GetDefaultCode() != val.GetCode() {
|
||||
code = val.GetCode()
|
||||
|
||||
Reference in New Issue
Block a user