From 493c6ebae88fd440ce39fdc8f70b8e6829b994a5 Mon Sep 17 00:00:00 2001 From: risqy Date: Tue, 25 Jul 2023 10:51:14 +0200 Subject: [PATCH] v0.0.208 remove context from err functions because its not used --- ginext/response.go | 12 +++++++++--- goextVersion.go | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ginext/response.go b/ginext/response.go index 96dac35..09efd6b 100644 --- a/ginext/response.go +++ b/ginext/response.go @@ -170,12 +170,18 @@ func Redirect(sc int, newURL string) HTTPResponse { return &redirectHTTPResponse{statusCode: sc, url: newURL} } -func Error(g *gin.Context, e error) HTTPResponse { +func Error(e error) HTTPResponse { return &jsonAPIErrResponse{ err: exerr.FromError(e), } } -func NotImplemented(g *gin.Context) HTTPResponse { - return Error(g, exerr.New(exerr.TypeNotImplemented, "").Build()) +func ErrWrap(e error, errorType exerr.ErrorType, msg string) HTTPResponse { + return &jsonAPIErrResponse{ + err: exerr.FromError(exerr.Wrap(e, msg).WithType(errorType).Build()), + } +} + +func NotImplemented() HTTPResponse { + return Error(exerr.New(exerr.TypeNotImplemented, "").Build()) } diff --git a/goextVersion.go b/goextVersion.go index c764c9c..3db0e7c 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.207" +const GoextVersion = "0.0.208" -const GoextVersionTimestamp = "2023-07-25T10:47:00+0200" +const GoextVersionTimestamp = "2023-07-25T10:51:14+0200"