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).
|
WithType(exerr.TypeBindFailJSON).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||||
Build()
|
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 {
|
} else {
|
||||||
if !pctx.ignoreWrongContentType {
|
if !pctx.ignoreWrongContentType {
|
||||||
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
|
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||||
Build()
|
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 {
|
if brc, ok := pctx.ginCtx.Request.Body.(dataext.BufferedReadCloser); ok {
|
||||||
v, err := brc.BufferedAll()
|
v, err := brc.BufferedAll()
|
||||||
if err != nil {
|
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
|
*pctx.rawbody = v
|
||||||
} else {
|
} else {
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
_, err := io.Copy(buf, pctx.ginCtx.Request.Body)
|
_, err := io.Copy(buf, pctx.ginCtx.Request.Body)
|
||||||
if err != nil {
|
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()
|
*pctx.rawbody = buf.Bytes()
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ func (j jsonAPIErrResponse) Unwrap() error {
|
|||||||
return j.err
|
return j.err
|
||||||
}
|
}
|
||||||
|
|
||||||
func Error(e error) InspectableHTTPErrorResponse {
|
func Error(e error) HTTPResponse {
|
||||||
return &jsonAPIErrResponse{
|
return &jsonAPIErrResponse{
|
||||||
err: exerr.FromError(e),
|
err: exerr.FromError(e),
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package goext
|
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