From 84f124dd4d62d75165850456ddea51cbf95614f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Tue, 16 Jul 2024 15:22:18 +0200 Subject: [PATCH] v0.0.485 --- ginext/preContext.go | 8 ++++---- ginext/responseJsonAPI.go | 2 +- goextVersion.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ginext/preContext.go b/ginext/preContext.go index 537b91b..2075d1e 100644 --- a/ginext/preContext.go +++ b/ginext/preContext.go @@ -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() } diff --git a/ginext/responseJsonAPI.go b/ginext/responseJsonAPI.go index 58b8e46..a2ffc07 100644 --- a/ginext/responseJsonAPI.go +++ b/ginext/responseJsonAPI.go @@ -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), } diff --git a/goextVersion.go b/goextVersion.go index eadb4b1..737562e 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -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"