v0.0.485
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m44s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m44s
This commit is contained in:
parent
ff8e066135
commit
84f124dd4d
@ -105,14 +105,14 @@ 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(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
||||
}
|
||||
} else {
|
||||
if !pctx.ignoreWrongContentType {
|
||||
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -121,14 +121,14 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
||||
if brc, ok := pctx.ginCtx.Request.Body.(dataext.BufferedReadCloser); ok {
|
||||
v, err := brc.BufferedAll()
|
||||
if err != nil {
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "URI", err))
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
||||
}
|
||||
*pctx.rawbody = v
|
||||
} else {
|
||||
buf := &bytes.Buffer{}
|
||||
_, err := io.Copy(buf, pctx.ginCtx.Request.Body)
|
||||
if err != nil {
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "URI", err))
|
||||
return nil, nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
||||
}
|
||||
*pctx.rawbody = buf.Bytes()
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ func (j jsonAPIErrResponse) Unwrap() error {
|
||||
return j.err
|
||||
}
|
||||
|
||||
func Error(e error) InspectableHTTPErrorResponse {
|
||||
func Error(e error) HTTPResponse {
|
||||
return &jsonAPIErrResponse{
|
||||
err: exerr.FromError(e),
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.484"
|
||||
const GoextVersion = "0.0.485"
|
||||
|
||||
const GoextVersionTimestamp = "2024-07-16T15:16:56+0200"
|
||||
const GoextVersionTimestamp = "2024-07-16T15:22:18+0200"
|
||||
|
Loading…
Reference in New Issue
Block a user