v0.0.485
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m44s

This commit is contained in:
Mike Schwörer 2024-07-16 15:22:18 +02:00
parent ff8e066135
commit 84f124dd4d
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
3 changed files with 7 additions and 7 deletions

View File

@ -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()
}

View File

@ -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),
}

View File

@ -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"