From fb847b03af9cdef2099ba6ac2d113c2d9a40fb26 Mon Sep 17 00:00:00 2001 From: risqy Date: Tue, 25 Jul 2023 10:47:00 +0200 Subject: [PATCH] v0.0.207 renamed APIError to Error --- ginext/funcWrapper.go | 2 +- ginext/preContext.go | 14 +++++++------- ginext/response.go | 4 ++-- goextVersion.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ginext/funcWrapper.go b/ginext/funcWrapper.go index 516cc5a..ce267e2 100644 --- a/ginext/funcWrapper.go +++ b/ginext/funcWrapper.go @@ -25,7 +25,7 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc { Str("trace", stackTrace). Build() - wrap = APIError(g, err) + wrap = Error(g, err) } if g.Writer.Written() { diff --git a/ginext/preContext.go b/ginext/preContext.go index ae94c88..fdf0b3d 100644 --- a/ginext/preContext.go +++ b/ginext/preContext.go @@ -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(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, 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(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, 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(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, err)) } } else { err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body"). Str("struct_type", fmt.Sprintf("%T", pctx.body)). Build() - return nil, nil, langext.Ptr(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, 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(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, err)) } } else { err := exerr.New(exerr.TypeBindFailFormData, "missing form body"). Str("struct_type", fmt.Sprintf("%T", pctx.form)). Build() - return nil, nil, langext.Ptr(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, 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(APIError(pctx.ginCtx, err)) + return nil, nil, langext.Ptr(Error(pctx.ginCtx, err)) } } diff --git a/ginext/response.go b/ginext/response.go index 94dc0cb..96dac35 100644 --- a/ginext/response.go +++ b/ginext/response.go @@ -170,12 +170,12 @@ func Redirect(sc int, newURL string) HTTPResponse { return &redirectHTTPResponse{statusCode: sc, url: newURL} } -func APIError(g *gin.Context, e error) HTTPResponse { +func Error(g *gin.Context, e error) HTTPResponse { return &jsonAPIErrResponse{ err: exerr.FromError(e), } } func NotImplemented(g *gin.Context) HTTPResponse { - return APIError(g, exerr.New(exerr.TypeNotImplemented, "").Build()) + return Error(g, exerr.New(exerr.TypeNotImplemented, "").Build()) } diff --git a/goextVersion.go b/goextVersion.go index 09081f8..c764c9c 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.206" +const GoextVersion = "0.0.207" -const GoextVersionTimestamp = "2023-07-24T18:50:14+0200" +const GoextVersionTimestamp = "2023-07-25T10:47:00+0200"