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"