v0.0.209 removed g context from err func

This commit is contained in:
2023-07-25 10:56:03 +02:00
parent 493c6ebae8
commit 15a4b2a713
3 changed files with 10 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc {
Str("trace", stackTrace).
Build()
wrap = Error(g, err)
wrap = Error(err)
}
if g.Writer.Written() {

View File

@@ -52,7 +52,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
WithType(exerr.TypeBindFailURI).
Str("struct_type", fmt.Sprintf("%T", pctx.uri)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
}
@@ -62,7 +62,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
WithType(exerr.TypeBindFailQuery).
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
}
@@ -73,13 +73,13 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
WithType(exerr.TypeBindFailJSON).
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
} else {
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
}
@@ -90,13 +90,13 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
WithType(exerr.TypeBindFailFormData).
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
} else {
err := exerr.New(exerr.TypeBindFailFormData, "missing form body").
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
}
@@ -106,7 +106,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
WithType(exerr.TypeBindFailHeader).
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
Build()
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
return nil, nil, langext.Ptr(Error(err))
}
}